|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectope.shopping2.Customer
public class Customer
This class represents a Customer who has a name and some money.
ShoppingCart
Constructor Summary | |
---|---|
Customer(java.lang.String name)
Creates a new customer object with given name. |
Method Summary | |
---|---|
boolean |
chargeMoney(double amount)
Charges some money from this person. |
boolean |
checkOut()
Checks out the person's shopping cart if he or she has sufficient amount of money. |
void |
clearCart()
Empties the customer's shopping cart. |
double |
getBalance()
Returns the balance of this person's bank account. |
ShoppingCart |
getCart()
Returns the customer's shopping cart. |
java.lang.String |
getName()
Returns the name of this customer. |
void |
receiveMoney(double amount)
Adds the given amount of money to this person's bank account. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Customer(java.lang.String name)
name
- the customer's nameMethod Detail |
---|
public java.lang.String getName()
public double getBalance()
public void receiveMoney(double amount)
amount
- the amount of money to be given.public boolean checkOut()
public boolean chargeMoney(double amount)
amount
- the amount of money to be charged.
public ShoppingCart getCart()
public void clearCart()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |