Question: Can someone help me with this in C++. I also need the file to show up in the output. /* LAB: Files (input) Reading from

 Can someone help me with this in C++. I also need

Can someone help me with this in C++.

I also need the file to show up in the output.

/* LAB: Files (input)

Reading from file

Name: */ #include #include #include

using namespace std;

int main() {

ifstream inFS(fileName); string fileName; string contentLine; string userinputName; int lineNum=0; cout > userinputName; cout

return 0; }

6.10 LAB: Files (input) Write a program that prompts the user to enter an input file's name. Here is an example of the program's screen: What is the name of the input file? test Once the user has entered the name of the input file, add the extension (.txt) to get the full name: test.txt. Then the program opens the file and displays its contents to the screen, one line at a time. Finally, it closes the file and displays the number of lines in the input file as shown below: The input file named "test.txt" has 5 lines. If the user enter the wrong name for the input file, display the following error message: There was an error opening the input file: "test.txt

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!