Starting from:
$30

$24

Homework #10 Solution

Write a program that reads words from a text file and writes (into another file) lists of words, by length.
Your program should build an array of words that have been read. As each word is read from the input file, the array should be checked to see if that word is already there. If not, the word should be added.
After all words have been read, you program should determine the length of the longest word in the array.
Finally, your program should output (into another text file) lists of words by length. First, all words with length 1 should be outputted on one line, separated by spaces. Next, all words with length 2, then 3, up to the longest word.
In order to determine the length of a word (string), use the string length method. For example, if we have a string named word, then it’s length can be acquired by calling the function word.length(), which returns an integer.
The executable program Gold10.exe provides demonstration of what your program should do.
Your program should be designed and implemented using top-down programming techniques: use functions for sub-tasks. The functions should be divided among three files: one for main, one for the tools, and one for the program-specific functions. You should turn in a structure chart that shows the structure of the program-specific functions in your program.
You should turn in (in a pocket folder): this assignment/grading sheet, a statement of completeness (see the back of this sheet), a structure chart, and printouts of your program-specific functions and any tools that you may invent. All items should be labeled appropriately. You should also place a “soft” (electronic) copy of a folder containing all of your project’s code and header files (.cpp and .h) into your private FTP folder.
 

More products