CS 1054: Introduction to Programming in JAVA

CS 1054 Introduction to Programming in Java (Spring 2008)

Project 1: Ice Cream Stations

Instructions

Write an IceCreamStation class in Java. An ice cream station sells ice cream cones, but needs to buy ice cream (by the pint) and cones (by the box) to make the ice cream cones. A box of cones contains 20 10 cones and has a fixed price of $2.50 per box; a pint of ice cream also has a fixed price of $3.25 per pint. To make an ice cream cone, you need a single cone and 1/4 of a pint of ice cream. The price of an ice cream cone is not fixed and is indicated during a sale.

An ice cream station should be able to monitor its inventory: how many cones it has left as well as how much ice cream it has left. In addition, it should keep track of how many ice cream cones it has sold so far and how much money it has on hand. When an ice cream station is created, start it off with $100.00.

You will need to implement the following methods for the IceCreamStation class:

For a more formal description of these methods, click on this Java documentation page .

You also need to create an IceCreamStationTester program that tests your IceCreamStation class. In this test program, create one or more IceCreamStation objects and call all methods of the IceCreamStation class. Both the IceCreamStation class and the IceCreamStationTester class should be in a BlueJ project called Project1 .

Document your classes. Include header comments and comments for each method of the class. Pattern your documentation according to the examples we have used in the lectures and in the labs.

This project is due on February 18 (11:59pm).

Instructions for submitting via Web-Cat