Must Procedural Code Use Global Variables Write Program C Generates Random Words Training Q37111432

MUST BE PROCEDURAL CODE, DO NOT USE GLOBALVARIABLES. Write a program in C++that generates randomwords from a training set as explained in the lectures on graphs.Do not hard-code the training set! Read it from a file. A suggestedformat for the input file:

6

a e m r s t

10

ate

eat

mate

meet

rate

seat

stream

tame

team

tear

Here are some suggestions for constants, array declarations, andhelper functions

#include <iostream>

#include <fstream>

#include <cstdlib>

#include <ctime>

#include <string>

using namespace std;

const int SIZE = 27; // 26 chars + 1

const int WORDSIZE = 25; // max word size

// read from input file

char cArray[SIZE]; // array of characters in set

char tArray[SIZE][SIZE]; // training array

//constructed by your program

int firstChars[SIZE]; //

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.