Fall 2012, The College of Saint Rose

Lecture 5: Java Fundamentals
Date: Tuesday, September 11, 2012 Agenda

• Announcements
• Lab 1 is now due, late clock is running
• Reminder/request: good subject lines on assignment submissions
• Even more imporant: good subject lines on questions about assignments
• Lecture assignment 4 recap
• Working with numbers
• reading and storing int values
• mathematical calculations
• In class exercise: compute miles per gallon
• floating-point numbers
• int vs. double division
• Operator precedence

Due at the start of class, Thursday, September 13.

Please submit answers to these questions in Blackboard by the start of class. We will discuss these questions at the start of class, so no late submissions are accepted.

1. Gaddis Checkpoint problem 2.22, p. 62 (3 points).
2. Suppose your program contains the following variables and values:
```  int a = 5;
int b = 12;
double c = 3.0;
```

Evaluate each of the expressions below. (3 points)

```  b + c

a / b

a + b + c

a / c

a + b / c

(a + b) / c
```

Examples