Lecture03: Numeric Expressions
In preparation for class, please do the following:
- Choose a computer and log into your account.
- Create or choose a folder for today's lecture.
- Use an internet browser to obtain this page.
- Download the files from this folder to your lecture
folder.
- Have pen and paper or a word processor ready to record important discoveries
and questions.
- Read the tips and review below.
Reminder: Lab01 is due in the drop box by 3pm Tuesday.
Tips
- Learning Tip: Take advantage of opportunities to practice your problem solving
skills.
- Programming Tip: Code in small doses.
- Learning and Problem Solving Tip: Try It! Experiment!
Review of Java Program Structure Covered So Far
- Each program is constructed by completing a class definition.
- A class definition consists of a class header followed by a collection
of
- variable declarations
- method definitions
grouped within curly braces.
- A method definition consists of a method header followed by a list of statements
grouped by curly braces.
- A method's name determines when the statements in the method are preformed.
In particular, the following names associate instructions with user actions:
- onMousePress
- onMouseRelease
- onMouseClick
- onMouseEnter
- onMouseExit
- onMouseMove
- onMouseDrag
- begin
- There are (at least) three kinds of statements:
- constructions (e.g., new FilledRect(150, 200, 100, 100, canvas) ),
- method invocations (e.g., ball.move(-10, 0)),
- assignments (e.g., ball = ... )
Demonstrations
For Reference Afterward