|
Write a program that prompts the user to enter text from the keyboard. The text is read until Ctrl+Z is entered, i.e., the end of file is reached. The program should count the frequency of each digit and of each letter of the alphabet (but it should not distinguish an uppercase letter from a lowercase letter). When the user finishes inputting text, the program should display each letter and its frequency in a table format. Also, the number of special characters (i.e. not letters nor digits) should be reported. Hint: Declare an array of counters, one for each letter and for each digit. Use the letter and the digit itself as the subscript that determines which array element to increment. To do this the program must convert the letter and the digit to the corresponding subscript (the ASCII values of the lowercase letters are 97 – 122, the ASCII values for the uppercase letters are 65 – 90 and the ASCII values of the 10 digits are 48-57).
Example: The following input: Th1s 1s a test.^Z Should produce the following result: 1 2 a 1 e 1 h 1 s 3 t 3 Special symbols:4 Additional requirements: - the program cannot use global variables - the program must contain at least two functions called count and printReport; formal parameters can be added to these functions (if necessary)
i was just wondering how do i start this??? im lost any help is appreciated
|