This website is preserved for historical and scholarly reference and is no longer actively maintained.
QUIZ 3
August 27, 1997
#1. Given the sequence of Java statements:
double salary = 356.75;
int n = (int) salary;
what value is assigned to n?
#2. What does the Java statement
do?
#3. Explain what the author means when he refers to a "magic number".
#4. What does the author say about the use of "magic numbers"?
#5-7. Name three types of characters that are considered "white space".
#8-9. Suppose that you wish to write your name as a comment in a program. Illustrate two different methods (different Java syntax) of writing your name as a comment.
#10. After the Java statement:
int nickels;
what do we know about the value in the integer variable nickels?