Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++. 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
C++.
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" 293630.1715672Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started