next up previous
Next: About this document

centering17

Use the vi editor to write a C program on the Sun cluster that prompts the user for an input file name. The input file should contain words (text) in any format. A word is defined as any string of characters separated from other strings of characters by one or more blanks, tabs, or newlines. Your program should read the first 100 words from the file (or the entire file if it contains less than 100 words) into an array of strings. Your program should then sort the array of strings alphabetically, write the sorted array to the screen, find the word that appears the most times in the array, and write this word and the number of times it appears to the screen. If there is a tie for the most frequent word, your program should output the most frequent word that appears earliest in the array. If the input file is empty, your program should indicate this and not output any frequency count.

More detailed specifications include:




next up previous
Next: About this document

Tim Wahls
Fri Mar 28 13:38:44 EST 1997