Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a program that will prompt the user for a file name to work with. Then prompt the user for a string to search for.

Create a program that will prompt the user for a file name to work with. Then prompt the user for a string to search for. The program will search the file for the string the user provided, each line in the file is a string. So a line should be read from the file, search the line for the string. If the string is in that line then it should display the line. If the string is not in the line then it should read the next line from the file. The program should also keep track of how many times it found the string and how many line from the file it has read completely. Provide the text file you created for this program.

c++

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions