/* Four essential ingredients for having a polymorphic method call: * 1) * 2) * 3) * 4) */ #include using std::cout; using std::endl; // Add class declarations and implementations HERE const double SAVINGS_INTEREST_RATE = 1.2; const double CD_INTEREST_RATE = 2.5; const int NUM_BANK_ACCOUNTS = 3; int main(){ SavingsAccount firstHome( 1234.56, SAVINGS_INTEREST_RATE); CheckingAccount gasMoney( 78.90); CDAccount tuition( 5000.00, CD_INTEREST_RATE, 6); Account* bankAccounts[ NUM_BANK_ACCOUNTS ]; // array of 3 Account pointers firstHome.deposit( 987.65); gasMoney.deposit( 12.34); firstHome.withdraw( 2000.00); int checkNumber = 234; gasMoney.processCheck( 55.55, checkNumber); bankAccounts[0] = &firstHome; bankAccounts[1] = &gasMoney; bankAccounts[2] = &tuition; bankAccounts[1]->deposit( 20.00); bankAccounts[1]->withdraw( 50.00); for( int i = 0; i < NUM_BANK_ACCOUNTS; i++){ cout << "(Bank account index " << i << ")\n"; bankAccounts[i]->printInfo(); cout << endl; } return 0; }