| Lexington High School Mathematics | Math Dept. Front Page | Student Links | Family Links |
| Introduction to C++, Kevin Kelly | Kelly Front Page | C++ Course Guide | C++ Assignments | C++ Info |
For this assignment you have to write two short programs, 26A and 26B. Hand in both programs at once, along with a run of the programs (as described below).
Program 26A: Rewrite Assignment 1 so that the output is sent to a data file named seuss.txt instead of to the screen.
Program 26B: Write a program that reads in the contents of the file seuss.txt and prints its contents on the screen.
Running the programs: You must show that your two programs work correctly, using a sequence of commands like the following.
The first command removes any pre-existing file called seuss.txt (if you get a "no such file" error message, that's OK). The second command should output nothing, and the third command should output the Dr. Seuss passage.[yourname@neon yourname]$ rm seuss.txt [yourname@neon yourname]$ assign26a [yourname@neon yourname]$ assign26b
[yourname@neon yourname]$ rm seuss.txt [yourname@neon yourname]$ assign26a What is your full name? Jo Smith [yourname@neon yourname]$ assign26b Here is some Dr. Seuss for Jo Smith. When a fox is in the bottle (etc.)