Ice Cream Shop Assignment

 



This assignment is to write a program with a GUI interface to simulate a touch screen for ordering at an ice cream shop. See CoffeeShop2 for an example for a Coffee Shop. The ice cream shop has 2 types of items, an ice cream cone and a dish of ice cream. A cone can have up to 3 scoops of ice cream (any combination of flavors). A dish can have up to 3 scoops of ice cream and one each of several toppings. The flavors and the cost of each flavor are in a file in the form flavor:cost one per line. For example



vanilla:1.00

chocolate chip:1.25



The toppings are in another file in a similar format.



Your program must read the flavors file, store the flavor and cost in a Flavor class (similar to the Drink class of the second CoffeeShop example) and construct a JButton for each flavor with the flavor as the button text. To do this, use an ArrayList of JButtons. Do the same for the toppings. Use a Topping class similar to the Addition class of the second CoffeeShop example. You should also have an IceCreamItem interface, a Cone class, a Dish class and a Decorator class. Make sure a cone or dish is chosen first (by disabling buttons) and if a cone is chosen, make sure a topping cannot be chosen. Have a finish button that displays the description and cost of the ice cream item in a nice format. For example, something like:



Cone with a double scoop of vanilla a scoop of chocolate

$3.50
Dish with a scoop of chocolate a scoop of strawberry a scoop of peach with walnuts with maple syrup and whipped cream

$5.10

Cone with a scoop of peach a scoop of chocolate a scoop of chocolate chip

$4.75



This assignment is due on June 27th at class time. There will be a quiz at the beginning of class. Hand in a printout of the source codes, the javadoc printout and a disk or CD with the source codes or send the source codes to me by e-mail. Use the data files flavors.data and toppings.data.