Six Lines File I/O Exercise (To be marked)
Given the following files:
- Use
ex2_readline.cppin the replit team project or copy the following code into your IDE:
- Use the input file
ex2_input.txtprovided in the replit team project or create the following in another IDE:Allan Smith John Cooper Zhang Hua Yao Ming
Do this:
- Edit the input data file
ex2_input.txtand the program fileex2_readline.cppin repl.- Add your full name and your CS110 class 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 class instructor's name in the input
data file
- Compile and run the program
ex2_readline.cpp. - Check the contents of the output data file.
- In the replit console you can use this command:
cat ex2_output.txtor you can click on the file name in the left panel.
- In the replit console you can use this command:
- Compile and run this C++ program.
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. Complete all the exercises in this lab before uploading the zip file produced by replit.