CSCI 235: Miscellaneous tips (including turning in programs)

Preparing a script

You will usually be asked to provide a script file that records you compiling and running your files. Here are the steps to take:

  1. First, remove the compiled (.class) versions of your files, using the rm command. If you want to get rid of all of the class files, you can use the command
    rm *.class
    
    You'll have to be more judicious if you were provided some class files that you need to keep.
  2. Now, start recording by giving the command
    script
    
    Everything that goes to your terminal will now also be recorded in the a file named typescript.
  3. List the directory, with long details:
    ls -l
    
  4. Compile your files. You might compile them one by one, or you could do
    javac *.java
    
  5. Run each program with inputs that have been chosen to show that your program works for a representative set of cases. Include the tricky cases.
  6. End the script with the command exit.

Printing a program and scripts

Decide what files you should print and in what order. You can print them all with
a2ps --file-align=virtual filenames ...
Some useful options for a2ps include:

Handing in files electronically

To turn in a lab or project electronically, use the command:
/cslab/class/csci235/bin/handin labname filenames ...
The labname (or project name) will be specified in the assignment. Include all of the files (usually Java source and a typescript) on a single command. Be sure that you see the report of successful submission. You can submit more than once; the last submission can always be found.


Cary Gray

Last modified: Mon Sep 12 10:51:45 CDT 2011

Valid HTML 4.01!