Tuesday
July 28, 2015

Homework Help: Programming

Posted by Scotty on Monday, February 25, 2008 at 2:10am.

How do I declare how many boxes there are and how much per box with this information.....
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:

* buyCones: buys cones by the box; number of boxes is indicated as a parameter
* buyIceCream: buys ice cream by the pint; number of pints is indicated as a parameter
* sellIceCreamCones: sells ice cream cones; both the number of ice cream cones and the unit price are indicated as parameters
* getConesLeft: returns the number of cones left
* getIceCreamLeft: returns the amount of ice cream left (in pints)
* getNumIceCreamConesSold: returns the number of ice cream cones sold
* getCashOnHand: returns the cash the station has on hand (in dollars)

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

More Related Questions

Members