public class RewardCard extends CreditCard
DEFAULT_LIMIT
Constructor and Description |
---|
RewardCard(int cardNum,
java.lang.String cardName,
java.util.Date expiry)
Initializes this object with the passed number, name, and expiry
date, and the default limit.
|
Modifier and Type | Method and Description |
---|---|
boolean |
charge(double amount)
Charges the passed amount to the card.
|
int |
getPointsBalance()
Returns the reward points balance for this card.
|
java.lang.String |
toString()
Returns the
toString representation of this object. |
getBalance, getExpiry, getLimit, getName, getNumber, pay, setLimit
public RewardCard(int cardNum, java.lang.String cardName, java.util.Date expiry)
cardNum
- The number of the credit card.cardName
- The name on the credit card.date
- The expiry date of the credit card.public boolean charge(double amount)
charge
in class CreditCard
amount
- The amount to charge on this card.public int getPointsBalance()
public java.lang.String toString()
toString
representation of this object.
The dollar values are rounded to two decimal places.toString
in class CreditCard
Katrina Brown; bal: $0.00; lim: $5000.00; points: 100
.