Lecture 3 Objectives [Oct 27]prev
next
OPENING LINE:
The Wheel of Time turns, and Ages come and pass, leaving
memories that become legend. Legend fades to myth, and even myth is long
forgotten when the
Age that gave it birth comes again. [The
Wheel of Time series,
Robert Jordan]
At the end of today's class you should
HAVE READ:
KNOW:
- if statement structure
-
The existence of the
java.lang.Math class
- The structure of computations: Sequential, Conditional
-
Know difference between (&&, ||) and (&, |)
BE ABLE TO:
- Write programs with conditional control flow, based upon
variable declarations
DAILY QUESTION:
- Write a program that defines an int variable
x. Set x to some integer value of your choosing. Then define
an if statement that will (a) output "Negative" if x is less
than zero; (b) output "Zero" if x is equal to zero; (c) output
"Positive" if x is greater than zero.
Sample Exam Question:
Given three int variables a, b, and c,
show the series of if statements you would use to output these three
values in ascending sorted order.
Go through all the steps in the design recipe in the development of your
program.