Six Lines File I/O Exercise (To be marked)
Given the following files:
- Use
ex2_readline.cpp
in the replit team project or copy the following code into your IDE:
- Use the input file
ex2_input.txt
provided 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.txt
and the program fileex2_readline.cpp
in repl.- Add your full name and your CS110 class instructor's name in the input
data file
ex2_input.txt
a line for each. - Modify the program
ex2_readline.cpp
to 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.txt
or 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.txt
andex2_output.txt
files. Complete all the exercises in this lab before uploading the zip file produced by replit.