Question: c++ language string search write a program that asks the user for a file name and a string for which two search the program should

c++ language

string search

write a program that asks the user for a file name and a string for which two search the program should search the file for every occurrence of a specified string. when the string is found, the line that contains it should be displayed. after all the occurrences have been located, the program should report the number of times the string appeared in the file.

use tale of two cities.txt for the text file and test your program by searching the file for words in the text file, such as:

it was

the worst of time

not in the text file should get 'not found' as a result

here is the tale of two cities.txt file

It was the best of times, it was the worst of times, it was the age of

wisdom, it was the age of foolishness, it was the epoch of belief, it was

the epoch of incredulity, it was the season of Light, it was the season of

Darkness, it was the spring of hope, it was the winter of despair, we had

everything before us, we had nothing before us, we were all going direct

to Heaven, we were all going direct the other wayin short, the period

was so far like the present period, that some of its noisiest authorities

insisted on its being received, for good or for evil, in the superlative

degree of comparison only.

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!