CS 1401, Quiz #2

Date: Wednesday, September 6, 2006
Class section (9:30 am or 11:30 am): _______________________________

1. For each of the following strings, write "yes" or "no" depending on whether the string is a legal names of a Java variable.; if your answer is "no", briefly explain why.

September5

5September

September 5

September_5

September$

2. Translate the following sequence of Java statements into English; show, step by step, what will happen after each of these statements.

double grade;



grade = 3.0;



grade = grade + 1.0;



3. What is the result of the following Java operations:

9 / 5

9.0 / 5.0

9 % 5

-9 % 5