CS 1401, Quiz #3

Date: Monday, September 18, 2006
Name: ____________________________________________________________
Class section (9:30 am or 11:30 am): _______________________________

1. For each of the following topics, write "yes" or "no" depending on whether this topic is covered in Chapter 4, the chapter that you were supposed to read before the class:

if-then statements

how to compare numbers

while loops

Graphical User Interfaces

2. The String variable today contains the text "September 18, 2006". What will be the value of the string newString after the following command:

newString = today.substring(0,8);

3. What is the main difference between storing an integer and storing a string in the computer? Hint: if you have a variable newString of type String, what exactly is stored in this variable?

4. A programmer defined a new object for writing into a file:
PrintWriter out = new PrintWriter("a:\\myfile.java");
and started writing into the file by using the following command:
out.println("This is a test.");
If this file originally contained your Lab 3, what will be the contents of this file after this command?