lab inheritance extend your account class using inheritance of classfrom lab 4 for s 5121949
Lab: Inheritance Extend your Account class using inheritance of classfrom Lab 4 for simplicity — class accountFX: public account Methods setExchangeRate(int rate) convertMOPtoRMB(int amountInMOP) exchangeRMBtoMOP(int amountInRMB) Data members RMB exchangeRate, e.g. exchangeRate=1.25 (default value 1.25 indefault constructor) — class accountSecurity: public account /* Assuming there is no transaction fee (no bid-ask spreadeither) */ Methods setHSBCpricePerShare(int price) buyHSBC(int numberShares) sellHSBC(int numberShares) Data members pricePerShare (default value MOP400 in default constructor) numberSharesHSBC? lab4: #include using namespace std; class Account{ public: //Constructor Account(){ balance = interestRate = 0.0; term =0;} Account(double b, double r, int t){ balance = b; interestRate = r; term = t; } //Accessor double getBalance() { return balance; } double getInterestRate() { return interestRate;} int getTerm() { return term;} //Mutator void Deposit(double amount){ balance += amount; } int WithDraw(double amount){ if (amount > balance) return -1; else { balance -= amount; return 1; } } void AdjustRate(double newRate){ interestRate = newRate; } void SetTerm(int newTerm){ term = newTerm; } void CalBalanceMaturity(){ double s = balance + balance * interestRate/100 * term/12; cout . . .