Homework Assignment 3

Due: November 6, 2006.

This assignment will give you practice at writing Java programs where:

Write Java programs to solve Problems 3, 8, 11 and 14 in the Java Exercises Handout (see the yellow book).

Most of what you need can be found on the "java examples" web page and in the yellow class reader. In past years, we have employed the method keyboardInput() to read input typed at the keyboard. Now that Java 5 is available, you should replace the method keyboardInput() with getTextFromConsole().


Note. For each problem, hand in a copy of your program source code and a script of I/O for typical program usage. To create a script, type something like:

    prompt >> script output-file

Now all input/output on the screen will be echoed to the file "output-file". To terminate the script, type:

    prompt >> exit

Now print "output-file" and hand it in.


Developed in October 2006 by Mark Austin
Copyright © 2006, Department of Civil and Environmental Engineering, University of Maryland