ARL Web Database Course, February 11, 1998
A Simple Java Application


  1. Copy these files to your "webhome" directory.

     cp ~njm/public_html/Java/lang/Average.java .
    and
     cp ~njm/public_html/Java/lang/Console.java .

    Use your text editor to modify the program Average.java so that it also finds the maximum of the numbers typed in. Note that you don't have to modify or compile the class Console.java; its method readInt is used by Average.java.

    Hints:

    Compile the java code described on this java compiler page and run.

  2. Introduce an integer array and store the integers as they are typed in. At the end of the loop, randomly pick one of the array elements as the "winner" and print it out.

    Hints:


    Nancy McCracken at the Northeast Parallel Architectures Center.