Exercise 5: Java Language Basics

CS 116

Sept. 25, 2002

  1. Take a look at the file Lesson5.java from the class home page. Try it out. Try entering both positive and negative values.

  2. Change the applet so that it will only add values that are both greater than 0 and less than 100. (You might want to check out the boolean operators !, && and || on pg. 189 in your text.)

  3. Add another Label to the applet which prints a message telling whether the current input value is less, equal, or greater than the value which was input just prior. (You will need to add another variable which stores the previous input.)

Thomas P. Kelliher
Tue Sep 24 12:23:47 EDT 2002
Tom Kelliher