CS 1401, Quiz #3

Date: Monday, September 17, 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 3, the chapter that you were supposed to read before the class:


storing numbers to a file


Graphical User Interfaces

2. Write a main method that asks the user to enter an real number, divides it by 2, and prints the result. Reminders: a main methods should start with

public static void main(String [] args){
and to read, we must declare a reader, e.g., as
Scanner console = new Scanner(System.in);

3. The String variable pessimist contains the text "I was very happy". What will be the value of the string changed after the following command:
changed = "I am" + pessimist.substring(5,pessimist.length());