CS 1401, Quiz 9

Date: Monday, October 29, 2007
Name (please type legibly, ideally in block letters): ______________________________________________________________________
Class section (9:30 am or 11:30 am): _______________________________

1. Mark what new material is covered and what is not covered in Chapter 9:

2. Define a class Pizza whose elements are (surprise!) pizzas. Each pizza is characterized by its size in inches, its list of toppings, its price, and whether its crust is thin or not. Your class should contain a constructor method, accessor methods, mutator methods, and a method for computing the area of the pizza. Reminder: the radius is half its size, and the area is pi (= 3.141592...) times the square of the radius.

3. Use your class in the main method to define a new 5-inch pizza with the toppings of your choice. Then, suppose that you got hungry and decided to increase the pizza's size to 10 inches. Show how to increase this size. Compute and print the area of this pizza.

4. Trace your program step-by-step.