Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions

Question

Find the Y parameters for the network shown. Zi

Answered: 1 week ago