class BankAccount {
public:
BankAccount();
BankAccount(int, int, float=0);
bool deposit(float amt); // returns true if deposit was made
bool withdraw(float amt); // returns true if withdrawal was made
float get_balance() const;
int get_account_num() const;
private:
int account_num;
int account_holder;
float balance;
};
class CheckingAccount: public BankAccount {
public:
CheckingAccount();
CheckingAccount(int, int, float=0, float=0, float=0);
bool charge_fee(); // return false if couldn't charge fee
float get_min_balance() const;
float get_service_fee() const;
void set_min_balance(float new_balance);
void set_service_fee(float new_service_fee);
private:
float minimum_balance;
float service_fee;
};
class SavingsAccount: public BankAccount {
public:
SavingsAccount();
SavingsAccount(int, int, float=0, float=0);
float get_interest_rate() const;
void set_interest_rate(float new_interest_rate);
void add_interest(); // compute interest and add it to balance
private:
float interest_rate;
};