|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectEggTrader
public class EggTrader
Class EggTrader simulates a person buying and selling eggs.
Constructor Summary | |
---|---|
EggTrader()
Constructor for objects of class EggTrader. |
Method Summary | |
---|---|
void |
buyOneDozen(double pricePerDozen)
Method buyOneDozen buys a dozen eggs. |
double |
getCash()
Method getCash returns the current balance. |
int |
getEggCount()
Method getEggCount returns the current egg count. |
void |
sellEggs(int numEggs,
double unitPrice)
Method sellEggs sells eggs. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EggTrader()
Method Detail |
---|
public void buyOneDozen(double pricePerDozen)
pricePerDozen
- price per 12 eggspublic double getCash()
public int getEggCount()
public void sellEggs(int numEggs, double unitPrice)
numEggs
- eggs being soldunitPrice
- selling price per egg
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |