Page 1 of 1

Suppose you have a text file called notes.txt. You are provided with this notes.txt file on the blackboard. Write a C++

Posted: Thu Jun 02, 2022 8:38 am
by answerhappygod
Suppose you have a text file called notes.txt. You are provided
with this notes.txt file on the blackboard. Write a C++ code to
display the word that appears most in the 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
• Your code will be recompiled during marking to see if it gives
the output you found.
• You are to complete this assignment individually.
• It is reasonable to discuss with others possible general
approaches to the given problem