Exercise, Quiz, & Test Keys by Charles E. Cook
Version 3.0.5k
Copyright © 2004 - 2007 by Charles E. Cook; Refugio, Tx
(All rights reserved)
This page is intentionally left blank.
Keys for Quizzes/Exercises/Projects
The short quizzes for each lesson in this section are not comprehensive and not very difficult. Normally, only basic, superficial questions are asked. The general philosophy here is for the specter of a quiz to always be hanging over the student where he knows he must quickly acquire a general working knowledge of the subject but at the same time knows he will not be asked in-depth or tricky questions. It is hoped that this gentle, but persistent pressure, will encourage the student to keep current with his studies and be rewarded with a frequent “100” on these little quizzes. It is suggested that a quiz be given the day after a new lesson is introduced.
Answers 1-1
Quiz on Lesson 1
1. Create the “skeleton” of a program.
2. Write a line of code that will cause the word Hello to be printed.
3. Consider the following code:
System.out.print(“Fire”);
System.out.println(“ Ants”);
Which of the following is actually printed?
a. Fire Ants
b. Fire
Ants
4. What is the syntax for indicating that a line of text is not Java code; rather, it is a rem?
Answers 1-2
Key to Quiz on Lesson 1
1. Create the “skeleton” of a program. public class Tester
{
public static void main(String args[])
{
}
}
2. Write a line of code that will cause the word Hello to be printed.
System.out.println(“Hello”);
3. Consider the following code:
System.out.print(“Fire”);
System.out.println(“ Ants”);
Which of the following is actually printed?
a. Fire Ants a b. Fire
Ants
4. What is the syntax for indicating that a line of text is not Java code; rather, it is a rem?
// should precede the text
Answers 1-3
Project… From Me To You, Key
//Author: Charles Cook
//Date created: Mar 22, 2005 public class Tester
{
public static void main(String args[])
{