Six Lines File I/O Exercise
Given the following files:
- Copy the following code and use the name
ex2_readline.cppin your Visual Studio or other IDEs:
- Create the input file
ex2_input.txtin the Visual Studio project or in another IDE with the following content:Allan Smith John Cooper Zhang Hua Yao Ming
Do this:
- Edit the input data file
ex2_input.txtand the program fileex2_readline.cppin Visual Studio.- Add your full name and your CS110 lab instructor's name in the input
data file
ex2_input.txta line for each. - Modify the program
ex2_readline.cppto work with your new input data file.
- Add your full name and your CS110 lab instructor's name in the input
data file
- Compile and run the program
ex2_readline.cpp. - Check the contents of the output data file.
When you are done:
- Observe the results in
ex2_output.txt. Check with your lab instructor if you aren't sure if they are correct. - Take a screenshot of your IDE and console window after running the program - there should be no output there.
- For this exercise, you will have:
ex2_readline.cpp,ex2_input.txtandex2_output.txtfiles. - Upload the above files in the UR Courses.
- Call your lab instructor for marking.