Announcements and Reminders
|
Topics |
Terminology |
||
Chapter 5 - File I/OTextbook Section 5.11Some Background
Streams
Opening a file
Checking for a file openClosing a fileDetecting EOFUsing type string to store a filenameHow to read to the end of file What happens if you read EOF? Examples 1. How would you write the numbers 1 - 100 in a file? 2. How would you write the numbers 1 - 100 in a file in columns of 10? 3. What is the average daily gain in the Dow Jones Industrial Average since the first of the year? 4. What is the lowest and highest share price for Apple over the last 10 years? 5. How do you copy a file? 6. How many words are in Martin Luther King's I Have A Dream speech? 7. How many times did Martin Luther King use the word, dream, in his I Have A Dream speech? 8. Can you rewrite MLK's speech and make it I Have A Vision? (change all the dreams to visions) 9. Encrypt a file by adding 5 to each character in the file. So if the input file looks like this:
then the output file would look like this:
Midterm Thursday
| text
file binary file stream ifstream ofstream fstream open() constructor fail() close() EOF parameterized manipulator EOF eof() function |