CS 160

Feb 23

Today's class
I will start the class with a little bit more on Applets, then go to conditional statements (chapter 5), if - if/else - else statements.
  • First, I gave a simple example for testing whether an input integer is odd/even. (1,2 below)
  • Second, I gave an example for determining whether a student should go to Harvard based on his/her TOEFL score (see 3 below)
  • Third, I gave an example for determining whether a year is a leap year. (see 4 below)
  • Finally, I gave an example for using the selection operator. (see 5,6 below)
1. Odd1.java 2. Odd.java
3. TOEFL.java 4. Leap.java
5. Select1.java 6. Select.java