#include <CreditCard.h>
Public Member Functions | |
CreditCard (std::string no, std::string nm, int lim, double rt, double bal=0) | |
std::string | getNumber () const |
std::string | getName () const |
int | getLimit () const |
double | getRate () const |
double | getCurrentBalance () const |
double | getPreviousBalance () const |
int | getMinPayment () const |
bool | chargeIt (double price) |
void | makePayment (double payment) |
int | endOfMonth () |
|
Construct a new credit card.
|
|
Attempts to make a charge of given price against this card. A charge should be disallowed if it would cause the credit limit to be exceeded. All negative charges should be disallowed (instead, they should be processed by making a payment)
|
|
This method is called to signify the end of a billing month. It is used to assess any fees or interest which are incurred and to record a new minimum payment required for the coming month. return the new minimum payment required |
|
Return the up-to-the-minute balance.
|
|
Return the credit limit.
|
|
Return the minimum payment ammount that was reported at the end of the previous month.
|
|
Return the name of the card holder.
|
|
Return the card number.
|
|
Return the account balance which was reported as of the end of the previous month.
|
|
Return the interest rate.
|
|
Used to make a payment on behalf of the account holder. Negative payments should be ignored. A positive payment is used to pay off a portion of the current balance. (if user pays off more than their current balance, the excess should still be credited in the form of a negative balance.) |