CS 1401, Quiz #4

Date: Tuesday, February 13, 2007
Name:____________________________________________________________
Class section (9 am or 10: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

while loops

arrays

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









3. A file data.txt contains two lines, the first line has a word February, the second line has the number 13. What will be the contents of this file after applying the following code:
    PrintWriter toFile = new PrintWriter("data.txt");
    toFile.print("I am answering Quiz 4. ");
    toFile.println("I will do well on it.");