CS 1401, Quiz #3

Date: Tuesday, February 7, 2006
Class section (9 am or 10:30 am): ______________________
Name: ______________________________________________________________________

1. Write down three lines of code which do the following:

(a) declare a variable of type String whose name is year:




(b) assign to the variable year (already defined elsewhere) the new value 2006:





(c) declare a constant (give it any name you want) with the value "Computer Science":





2. Write down a method which takes a string which contains the first name (for example, "John") and returns a longer string which says "My name is (the name of the input)." For example, if the input is "John", then your method should return the string "My name is John." Your methods should not read or write anything, just take a string and return a longer string.









3. Mark which topics are covered in the chapter that you were supposed to read by today.

a) arithmetic operations

b) arithmetic expressions

c) division

d) arrays

e) writing into a file