Answered step by step
Verified Expert Solution
Question
1 Approved Answer
QUESTION 5 [14] Consider the class specification (interface) for the class BankAccount below class BankAccount { public BankAccount(), BankAccount (int accNr, double initBalance), void setAccNY(int
QUESTION 5 [14] Consider the class specification (interface) for the class BankAccount below class BankAccount { public BankAccount(), BankAccount (int accNr, double initBalance), void setAccNY(int nr), int getAceNr() const, double getBalancel ) const, void deposit (double amnt), void withdraw(double amnt); string obtainAccInfo ( ) const, //return a string with accNr and 1) balance private int accNr. double balance, 7 COS1512/RCO1512 May/Jun 2017 51 Derive a class SavingsAccount from the class BankAccount This class has an additional member variable interest Rate representing the interest rate on the savings account The class also has additional member functions setInterestRate().getInterestRate() and post InterestRate() Member function postInterestRate() adds earned interest to the balance The class should override member function displayAccInfo() to return a string with the account number, current balance and interest rate Provide only the interface of the class SavingsAccount in terms of a header file The header file should contain compiler directives to prevent multiple definitions Assume that the interface of class BankAccount is contained in an interface file called BankAccount h (9)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started