C++ Programming
Part 1 questions
What are the three basic opening modes for a file in C++ and how do they affect the processing of the file?
- What is the difference between sequential and random file access?
- What is the end-of-file condition and how do you use it in a program?
Part 2
Write a program that creates file myStory.txt. Write the following lines out to the file:
I love to code
I really love to code in C++
Coding makes me very happy
Give me more code to write
The program should then read in the file myStory.txt and display it to the screen.
First, describe your algorithm using pseudocode.
Translate the pseudocode into a C++ program. You must comment your program including comments at the top of the file that explains what the program does and comments for every line of code that explains what is happening for the line of code. Apply troubleshooting and testing strategies to ensure your code compiles, runs, and provides accurate results.