Is-A Relationship
easyQuestion 129A base class Account has been provided with a protected double balance, a constructor, and a getBalance() function.
A derived class SavingsAccount publicly inherits from Account and has an additional double interestRate. The constructor has already been implemented.
Your task is to implement the calculateInterest() function. It should return balance * interestRate.
Do NOT include a main function. Your code will be tested automatically.
Expected output
Interest: 50= newline. The output ends with a newline, so print one after the last line.
Hints2 available
Sign in to use hintsTopics
Inheritance
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.