// File: account.h // Header file for the account class class account { protected: double balance; // current balance public: account(double bal); // the constructor account(void); // default constructor void deposit(double amt); double getBalance(void); }; // account // File: account.cpp // implementation file for the account class #include "account.h" account::account(double bal) { balance = bal; } account::account(void) { balance = 0; } void account::deposit(double amt) { balance += amt; } double account::getBalance(void) { return balance; } // file accountDemo.cpp #include #include "account.h" void main(void) { account a(50.45), b; // a has $50.45, b has $0.0 initially a.deposit(30); cout << " account a now has $" << a.getBalance() << endl; b.deposit(130); cout << " account a now has $" << b.getBalance() << endl; }