**Tom Kelliher, CS 116**

**Sept. 25, 2002**

Collect lab write-ups.

Read over Soda Pop lab.

Finished up Lab 4.

- Arithmetic variables and expressions.
- Boolean Expressions and the
`if`

statement. - Exercise.

Lab 5.

- Numeric variables may be declared as
`int`

(for integers) or either`float`

or`double`

(for reals). - Addition, subtraction, multiplication, and division of numeric values
are performed with the operators
`+`

,`-`

,`*`

,`/`

. - The value stored in numeric variables may be changed with an
assignment statement:
var = expression;

- Values can be added to a variable with
var += increment;

Similarly for`-=`

,`*=`

, and`/=`

.

- Comparisons of numeric values can be made with the operators
`<`

,`>`

,`==`

,`!=`

,`>=`

, and`<=`

.For example, the operator

`==`

returns`true`

if the values are equal and`false`

otherwise. The operator`!=`

returns`true`

if the values are not equal and`false`

otherwise. - An if statement is of the form
if (<boolean expression>) statement;

orif (<boolean expression>) statement; else statement;

The boolean expression evaluates to either`true`

or`false`

. The following statement is executed only if the expression is`true`

. The expression after the`else`

is only executed if the boolean expression is false.

Refer to handout.

Tue Sep 24 11:57:14 EDT 2002