#include <CreditCard.h>
Public Member Functions | |
CreditCard (std::string no, std::string nm, int lim, double rt, int bal=0) | |
std::string | getNumber () const |
std::string | getName () const |
int | getLimit () const |
double | getRate () const |
int | getCurrentBalance () const |
int | getStatementBalance () const |
int | getMinPayment () const |
bool | chargeIt (int price) |
void | makePayment (int payment) |
int | processMonth () |
|
Construct a new credit card.
If the given limit is negative, it will be set to zero. If the given interest rate is negative, it will be set to zero. An initial balance may be negative (for example on a debit card which has preallocated funds). |
|
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.
|
|
Return the up-to-the-minute balance.
|
|
Return the credit limit.
|
|
Return the minimum payment ammount that was computed in the most recent call to processMonth.
|
|
Return the name of the card holder.
|
|
Return the card number.
|
|
Return the interest rate.
|
|
Return the account balance as it existed at the conclusion of the most recent as of the end of the previous month.
|
|
Used to make a payment on behalf of the account holder. 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.) Negative payments should be ignored.
|
|
This method performs all processing to reflect the typical end of a monthly cycle. 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 (measured in cents) |