CS 1401, Quiz #4

Date: Monday, September 24, 2007
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

"and" and "or" operations


2-D arrays

2. What will be the result of a formatting operation String.format("%.2f", 3.141592)? Explain your answer.

3. A file data.txt contains two lines, the first line has the date September 24, the second line has the year 2007. What will be the contents of this file after applying the following code:
    PrintWriter toFile = new PrintWriter("data.txt");
    toFile.print("Summer is finally over. ");
    toFile.println("This is one of the first days of Fall.");