Question: Can someone help with this? In C 3:33 PM cs.sfu.ca .'ll Home 8. Letter trequency Requirements Write a program that calculates the frequency of letter

Can someone help with this? In C  Can someone help with this? In C 3:33 PM cs.sfu.ca .'ll

3:33 PM cs.sfu.ca .'ll Home 8. Letter trequency Requirements Write a program that calculates the frequency of letter occurrences in text .Read ASCII text from standard input. On reaching EOF, print to stdout the normalized frequency of occurrence for each letter a-z that appeared in the input, one per line, in alphabetical order using the format produced by printf( "%c %.4f ", letter, freq ); Letters that occur zero times should not appear in the output. Characters other than lower and upper case letters should be gnored. .Lower and upper case instances count as the same letter, e.g. a' and 'A' are both reported for the letter 'a' on the output. The frequencies reported should sum to approximately 1 (with a little slack for accumulation of printf rounding errors) Example runs Assume you have named your executable lfreq. The first two example runs show the user entering the text manually in the terminal. The third and fourth runs have text piped in from a file (and the middle of the alphabet is omitted from the output for brevity). A text file happy_prince.txt containing a classic story in English is provided for testing. ./lfreq aaab a 0.7500 b 0.2500 /lfreq g 1.0000 ./lfreq happy_prince.txt a 0.0841 b 0.0140 0.0206 y 0.0240 z 0.0002 ./lfreq"large novel in English.txt" a 0.0817 b 0.0149 0.0278 y 0.0197 z 0.0001

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!