Lab 3: Prelab Questions

Written Questions

Question #1: In an expression, a(n) ____________ is an object (i.e., data), and a ____________ is an operation (i.e., action).

Question #2: Output is done with the ____________ object using the ____________ operator. Input is done with the ____________ object using the ____________ operator.

Question #3: List the five arithmetic operators.

Question #4: List the six relational operators.

Question #5: List the three logical operators.

Programming Exercises

Code #1: Write an arithmetic expression to multiply unitCost and unitCount.

Code #2: Write an relational expression to test if unitCount1 is less than unitCount2.

Code #3: Write a logical expression to test if foo() and bar() are both true.

Code #4: Write a function expression that computes the cosine of 3.14159.

Code #5: Write an assignment expression that sets unitCost to 19.99. (Note: this is not a declaration.)

Lab Exercise
Report errors to Larry Nyhoff (