#include #include using namespace std; // #include "bankaccount.h" // the above line shouldn't be included since checkingaccount.h already includes it #include "checkingaccount.h" int main() { bankaccount myacct; // default constructor is invoked bankaccount namedaccount( 123, "John Smith" ); // constructor with parameters is invoked myacct.deposit( 1000.00 ); myacct.withdraw( 200.00 ); cout << myacct.getnumber() << " balance: " << myacct.getbalance() << endl; namedaccount.deposit( 5000.00 ); namedaccount.withdraw( 2000.00 ); cout << namedaccount.getnumber() << " balance: " << namedaccount.getbalance() << endl; // can't do the following (access balance directly) because the variable is private // namedaccount.balance = 1000000.00; checkingaccount anotheraccount; anotheraccount.setname( "Michael Jones" ); anotheraccount.setnumber( 456 ); anotheraccount.deposit( 5000.00 ); // bankacount's deposit() anotheraccount.drawcheck( 3600.00 ); // checking account's drawcheck(); anotheraccount.withdraw( 1000.00 ); // which withdraw() method does this invoke? cout << anotheraccount.getnumber() << " balance: " << anotheraccount.getbalance() << ", checks drawn: " << anotheraccount.getnumchecksdrawn() << endl; // can't do the following because the method is private // anotheraccount.applypenalty( 10.00 ); return 0; }