Question: Variables dataFileName, input 1 , input 2 , input 3 , input 4 , and input 5 , are read from input. Perform the following

Variables dataFileName, input1, input2, input3, input4, and input5, are read from input. Perform the following tasks:
Open dataFileName as the output file.
If the output file fails to open, then use cout to output dataFileName followed by ": error occurred while opening file" and a newline. Then, terminate the program with 1 as the return value.
Otherwise, for strings input1, input2, input3, input4, and input5, write "Item: " followed by the string 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 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 Programming Questions!