Question: c++ Write a program that asks the user for 1) the name of a file that exists in the same directory as the running program

c++

c++ Write a program that asks the user for 1) the name

of a file that exists in the same directory as the running

Write a program that asks the user for 1) the name of a file that exists in the same directory as the running program and 2) a word and displays to a console 1) the number of times the individual word was found in the file 2) the percentage of words in the file that was the word, and 3) the total number of words in the file. Suppose that I have a file called matt.txt with the following contents in the same working directory: the dog was super happy that the cat came to play If the user types in matt.txt and the word the, the console should display 2, 18.1818%, and 11. If the user types in matt.txt and the word bob, the console should display 0, 0% and 11 respectively. The program may assume the file exists on disk and no error checking is needed. The file may be assumed to contain 1 word per line

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!