How to Submit Programming Assignments

(Thanks to Quincy Stokes for setting this up)

After you are satisfied with your program, prepare your submission in the following way. The goal is to print out a single document that contains the source code, followed by the compilation report, followed by an example execution. To do this, we use the following sequence of UNIX commands (the example is prepared for Homework #1):

% script savestuff
% cat hw1.c
% g++ -o hw1.out hw1.C
% hw1.out

As you can see, there are 4 steps. The command script savestuff initiates recording (until further notice) of everything you see in the Unix window into the file savestuff (you could choose any other name you like for this file). Whatever you type, and whatever output/responses appear on the screen in return, all gets recorded in the specified file.

When you next type cat hw1.C, the file hw1.C is displayed (rapidly) on the screen, and thus saved in the savestuff file. Similarly, typing g++ -o hw1.out hw1.C compiles the file hw1.C using the g++ compiler for the C++ language, saving the executable translation produced into a new file called hw1.out (again, you could choose any other name for this file). Your TA will be able to see that your program has compiled correctly, since any system messages (e.g., error notices) that are displayed on your screen as the compilation progresses will be recorded as well in the file savestuff.

By now typing h1.out you order the computer to execute the program you just compiled. All interaction with the program will also be recorded, so just run your program as you normally would.

When you are finished running the program and you again see a UNIX prompt % on the screen, type exit. This will terminate the script command that you initially typed in. Recording into file savestuff is now finished; this is the file to print out and turn in. You can print it in several ways. The standard command is lpr savestuff but alternatively enscript -2rG savestuff has the advantage that it prints in 2-column landscape (sideways) format with a slightly smaller font, and so uses less paper which saves on printing charges.

NOTE: If you choose to do your homework on a system other than RCS (e.g. your personal computer), then you are responsible for figuring out how to do the equivalent of the above yourself.


<---- TAKE ME BACK TO CS1

John Escobar
Wed Feb 26 2:00:49 EDT 1997