Unix Lab 2

CS 245

Sept. 22, 2004

  1. Write (using emacs), compile, and run a small Java application. This program should interactively read positive integers, each on a single line, stopping when a 0 is entered. It should then print the largest integer read. Look back at Prog.java if you've forgotten how to do console I/O.

  2. Use script to record a script of compiling and running your program (read the man page script to learn how to use it. Use pine to e-mail the script to me as an attachment.

  3. After you've gotten your program running, print it.

  4. Work the emacs tutorial. From the command line, run emacs and use the C-h t command to start the tutorial.

  5. Referring to the tutorials on the class home page for Java's command line debugger, jdb, try setting some break points, single-stepping your program, and examining variable and object values. Before running jdb, compile your program with debugging enabled:
    javac -g Prog.java
    
    Next, start jdb and have it load your class file:
    jdb Prog
    



Thomas P. Kelliher
Tue Sep 21 14:48:34 EDT 2004
Tom Kelliher