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