 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
//base
class
|
|
class
account {
|
|
public:
|
|
account();
|
|
void statement();
|
|
private:
|
|
char name[32]; //account owner
|
|
float balance; //account balance
|
|
};
|
|
|
//checking
class derived from account
|
|
class
checking : public account {
|
|
public:
|
|
checking();
|
|
float get_charges();
|
|
private:
|
|
float charges; //charges for current month
|
};
|
|
|
//savings
class derived from account
|
|
class
savings : public account {
|
|
public:
|
|
savings();
|
|
float get_interest();
|
|
private:
|
|
float interest; //interest for current
month
|
|
};
|
|