CS 230 Fall 2009

Assignment 2 –Simple GUI and Calculations

100 points

 

Assigned: 09/14/2009

Due: 09/21/2009 at the start of class

 

Pre-Lab (Do Before Lab):  Bring materials – a way to save a copy for you and a copy to turn in. Plan out tasks, objects, and events needed for program.

 

Main Assignment:

Imagine that you are writing a program for a small computer you carry with you. Imagine that your favorite food is pizza, and you like to see what is the best pizza deal (e.g. the 14 inch round pizza for $10.99 or the 16 inch round pizza for $14.99, or the 8 X 12 inch Sicilian (rectangle) pizza for $16.99) since you’re perfectly happy to take any leftovers home for breakfast tomorrow. Write a program that calculates the price per square inch for pizza from a restaurant. This will require obtaining the price of the pizza, and either the diameter of the pizza (in inches) (in the case of a round pie) or the length and width (in the case of a Sicilian pizza). The task also involves performing calculations and displaying the output. In addition to the cost per square inch, also display intermediate results: the radius (for round) and the area (for either - in square inches).  Provide capabilities to calculate round, calculate rectangle, clear the text boxes to start again, and to exit.

Please set the name of the project to something other than the default name (WindowsApplication1, …). It is helpful if you use a name that identifies you as well as the assignment (e.g. yourlastname assignment 2).

 

Background Knowledge:

 

Task Details:

 

Miscellaneous:

 

Hand in: