#include <credit_card.h>
|
| CreditCard (std::string cust, std::string bk, std::string acnt, int lim, double initial_bal=0.0) |
| Constructs a new credit card. The initial balance is 0.0 by default.
|
|
std::string | get_customer () const |
| return the customer's name
|
|
std::string | get_bank () const |
| return the bank's name
|
|
std::string | get_account () const |
| return the account number as a string
|
|
int | get_limit () const |
| return the credit limit (measured in dollars)
|
|
double | get_balance () const |
| return the current balance (measured in dollars)
|
|
bool | charge (double price) |
|
void | make_payment (double amount) |
| Processes customer payment to reduce the balance.
|
|
◆ CreditCard()
dsac::design::CreditCard::CreditCard |
( |
std::string |
cust, |
|
|
std::string |
bk, |
|
|
std::string |
acnt, |
|
|
int |
lim, |
|
|
double |
initial_bal = 0.0 |
|
) |
| |
|
inline |
Constructs a new credit card. The initial balance is 0.0 by default.
◆ charge()
bool dsac::design::CreditCard::charge |
( |
double |
price | ) |
|
|
inline |
Charges the give price to the card, assuming sufficient credit limit.
- Parameters
-
price | the amount to be charged |
- Returns
- true if charge was accepted; false if charge was denied
◆ get_account()
std::string dsac::design::CreditCard::get_account |
( |
| ) |
const |
|
inline |
return the account number as a string
◆ get_balance()
double dsac::design::CreditCard::get_balance |
( |
| ) |
const |
|
inline |
return the current balance (measured in dollars)
◆ get_bank()
std::string dsac::design::CreditCard::get_bank |
( |
| ) |
const |
|
inline |
◆ get_customer()
std::string dsac::design::CreditCard::get_customer |
( |
| ) |
const |
|
inline |
return the customer's name
◆ get_limit()
int dsac::design::CreditCard::get_limit |
( |
| ) |
const |
|
inline |
return the credit limit (measured in dollars)
◆ make_payment()
void dsac::design::CreditCard::make_payment |
( |
double |
amount | ) |
|
|
inline |
Processes customer payment to reduce the balance.
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & |
out, |
|
|
const CreditCard & |
c |
|
) |
| |
|
friend |
◆ balance
double dsac::design::CreditCard::balance |
|
protected |
The documentation for this class was generated from the following file: