Question: Variables nameOfFile, line 1 , line 2 , and line 3 , are read from input. Perform the following tasks: Open nameOfFile as the output
Variables nameOfFile, line line and line are read from input. Perform the following tasks:
Open nameOfFile as the output file.
If the output file fails to open, then use cout to output nameOfFile followed by : error occurred while opening file" and a newline. Then, terminate the program with as the return value.
Otherwise, for strings line line and line write # followed by the string and # and a newline to the output file.
Close the file.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
