public class RewardCard
extends CreditCard
Constructor and Description |
---|
RewardCard(int cardNum,
java.lang.String cardName)
Initializes this object with the passed number and name, 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. |
public RewardCard(int cardNum, java.lang.String cardName)
cardNum
- The number of the credit card.cardName
- The name on 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
.