Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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++

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases In Networked Information Systems 6th International Workshop Dnis 2010 Aizu Wakamatsu Japan March 2010 Proceedings Lncs 5999

Authors: Shinji Kikuchi ,Shelly Sachdeva ,Subhash Bhalla

2010th Edition

3642120377, 978-3642120374

More Books

Students also viewed these Databases questions

Question

=+applying to all or most employers and employees?

Answered: 1 week ago

Question

=+associated with political parties and if so, which ones? Are

Answered: 1 week ago