|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectIceCreamStation
public class IceCreamStation
This class represents ice cream station objects. An ice cream station buys cones and ice cream to sell ice cream cones. It also monitors how much ice cream, cones, and cash it has left, as well as how many ice cream cones it has sold.
Constructor Summary | |
---|---|
IceCreamStation()
Class Constructor. |
Method Summary | |
---|---|
void |
buyCones(int numBoxes)
Buys one or more boxes of cones. |
void |
buyIceCream(double pints)
Buys some pints of ice-cream. |
double |
getCashOnHand()
Returns the cash on hand in the station. |
int |
getConesLeft()
Returns the cones left in the station. |
double |
getIceCreamLeft()
Returns the amount ice cream (in pints) left in the station. |
int |
getNumIceCreamConesSold()
Returns the number of ice cream cones sold. |
void |
sellIceCreamCones(int numCones,
double unitPrice)
Sells one or more ice cream cones at a given price. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IceCreamStation()
Method Detail |
---|
public void buyCones(int numBoxes)
numBoxes
- number of boxes to be boughtpublic void buyIceCream(double pints)
pints
- pints to be boughtpublic double getCashOnHand()
public int getConesLeft()
public double getIceCreamLeft()
public int getNumIceCreamConesSold()
public void sellIceCreamCones(int numCones, double unitPrice)
numCones
- number of cones to be soldunitPrice
- price of each ice cream cone
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |