Question: Suppose you have a text file called notes.txt . You are provided with this notes.txt file on blackboard. Write a C + + code to
Suppose you have a text file called notes.txt You are provided with this notes.txt file on blackboard. Write a C code to display a word which appears most in notes.txt file and how many times the word appears. This is called word frequency. Your code should automatically find this word that appears most in the text file and also should automatically calculate how many times this word appears. Your code should be such that when I use it to count words from a file with million words, it should tell me which word appears most, this means I do not need to look at the file to know the word first. Your code should also count the number of characters in the word you found and also convert the word to all CAPS. Your code should also count the total number of words in the file.
For example, suppose a text file has the following text:
Apple
Mango
Apple
Apple
The code will read from this file then the output should look like this:
The word that appears most is: Apple
Apple appears: times
Number of characters: Apples has characters
Word in ALL CAPS: APPLE
Total number of words in the file :
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
