CS 1401, Quiz #5

Date: Monday, October 3, 2005
Name (please type legibly, ideally in block letters): ______________________________________________________________________

1. A pizza place promises a large pizza for $6, two large pizzas for $5.50 each, and $5 per pizza if ordering three or more pizzas. Assuming that we are given the variable numberOfPizzas, write down a piece of code that assigns the corresponding value to the variable costOfPizzas.














2. A climate in the area is considered warm is both the average summer temperature and the average winter temperature are 65 or above. Write down a piece of code that, given the average temperatures summer and winter, assigns the corresponding value to the Boolean variable warm.










3. So far, we used objects of the class BufferedReader for the computer to read what we type on the keyboard. How else are objects the class BufferedReader used in Java? Hint: it has something to do with files.