Question: Can you fix the problem with the following code #include #include using namespace std; class bankAccount {public: bankAccount(int,double); void setAccNum(int); int getAccNum(); double getBalance(); void

Can you fix the problem with the following code

#include #include using namespace std; class bankAccount {public: bankAccount(int,double); void setAccNum(int); int getAccNum(); double getBalance(); void withdraw(double); void deposit(double); void print(); protected: int accNum; double balance; }; class savingsAccount: public bankAccount {public: savingsAccount(int,double); void setRate(double); double getRate(); void withdraw(double); void postInterest(); void savingsAccount::print(); protected: double rate; }; class checkingAccount: public bankAccount { public: checkingAccount(int accNum,double bal); double getMinBal(); double getRate(); double getFee(); void setMinBal(double); void setRate(double); void setFee(double); void postInterest(); bool checkMinBal(double); void checkingAccount::writeCheck(double); void withdraw(double); void print(); protected: double rate,minBal,fee; }; bankAccount::bankAccount(int n,double b) {accNum=n; balance=b; } void bankAccount::setAccNum(int a) {accNum=a; } int bankAccount::getAccNum() {return accNum; } double bankAccount::getBalance() {return balance; } void bankAccount::withdraw(double a) {balance-=a; } void bankAccount::deposit(double a) {balance+=a; } void bankAccount::print() {cout<=minBal) return true; else return false; } void checkingAccount::writeCheck(double a) {withdraw(a); } void checkingAccount::withdraw(double a) {if(balance-a<0) cout<<"insufficient funds for $"<

{ checkingAccount a(1234,1000); checkingAccount b(5678, 450); savingsAccount c(91011, 9300); savingsAccount d(121314, 32); a.deposit(1000); b.deposit(2300); c.deposit(800); d.deposit(500); a.postInterest(); b.postInterest(); c.postInterest(); d.postInterest(); a.print(); b.print(); c.print(); d.print(); a.writeCheck(250); b.writeCheck(350); c.withdraw(120); d.withdraw(290); a.print(); b.print(); c.print(); d.print(); system("pause"); return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!