Post date: Oct 05, 2019 6:8:44 PM
Flow of Control
3.1 Branching Mechanism
Recommended Self-Test Exercises:
p 143: Ex. 9 and 10.
p 152: Ex. 17.
p 163-164: Ex. 19 and 21.
Lab Exercises:
Write a Java program that reads an integer using Scanner then tests if it is odd or even. The format of the input and output should be as follows:
Please enter a number: 10
10 is even.
Write a program that asks the user to enter 3 real numbers between 0 and 100, then display the average of these numbers, and then display "Sorry!" if the average if lesser than 60, or "Congratulations!" otherwise.
Write a program that reads the temperature of the water and then it displays "Solid" if the temperature is zero or below, "Vapor" when the temperature is greater or equal to 100, "Liquid" otherwise.