We have been asked to develop a word analyzing application in C.
Here is the problem placed down:
1. Character analyser module, which provides functions to establish: - Number of characters in the text (including letters, digits, spaces, symbols, etc.). - Number of letters in the text. - Number of digits in the text. - Number of other characters (symbols etc.) - Frequency distribution of all letters (the amount of relative occurrence of each letter in the text as percentage (as a figure between 0.0%-100.0%), i.e. 5.34% of all characters might be an ‘a’, 1.2% might be a ‘b’ etc.). - Frequency distribution of all digits (i.e. the amount of relative occurrence of each digit in the text as percentage,). - Summary report, which returns a string containing the number of characters, letters, digits and other characters. - None of these functions should interact directly with the user – all input from user and output to user should be performed in the application module (see below).
2. Word analyser module, which provides functions to establish: - Number of words in the text (see definition of “word” below). - A list of all unique words occurring in the text (each word is stored only once and words are kept in order of appearance). Ensure your module can handle at least 200 unique words. - Number of unique words (i.e. how many different words appear in the file – this is not case sensitive and the words “card” and “Card” are counted as the same word). - Number of occurrences of a specific word. - Summary report, which returns a string containing the number of words in the file and the number of unique words number of characters, letters, digits, whitespaces and symbols. - None of these functions should interact directly with the user.
3. Application module, which performs all input/output interactions with the user a) Prompt the user to choose either character analyser or word analyser b) Prompt the user for the filename c) Obtains the summary report from the analyser and displays the report to the screen. d) Offer to get result from any analyser module function (depending on type of analyser, e.g. if word analyser is chosen, then user can pick either “number of words in text”, “number of unique words”, “list of unique words”, “Number of occurrence of specific word ‘xxx’ ”, “summary report” or “leave menu”). If “leave menu” is chosen, offer “Choose new analyser” (goes back to step a), “Choose new file” (goes back to step b) or “Exit application”.
So far we have finished up with part 1 and are feeling ok on part 3, but we are stumped on part 2.
Any help I could get on part 2 would be great!