Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Next, create a SavingAccount class which is derived from the generic class BankAccount. It should at least have one additional data member, i.e., 'status' that

image text in transcribed

Next, create a SavingAccount class which is derived from the generic class BankAccount. It should at least have one additional data member, i.e., 'status' that will be used to show whether account is active or inactive. . In C++, Create a class BankAccount to hold at least the following data / information about a bank account: Account balance Total number of deposits Total number of withdrawals Interest rate e.g., annual rate = 0.05 Service charges per month The class should have the following member functions: If the balance of a savings account falls below RM 25, it becomes inactive and the account holder will not be able to perform withdraw operation anymore until the balance is raised above RM 25. If balance becomes greater than or equal to RM 25, the account will become active again. The most common member functions of the SavingAccount class are given below. Constructor depositAmount withdrawAmount depositAmount A function which first checks whether the account is active/inactive before making a deposit. If inactive and the deposit brings the balance above RM 25, the account will become active again. The deposit will then be made by calling the base class version of the function. withdrawAmount A function which first checks whether the account is active/inactive before making a withdrawal. If active, the withdrawal will be made by calling the base class version of the function. This function first checks the no. of withdrawals before calling the base monthlyProcessing class version of this function. If the number of withdrawals are more than 4, a service charge of RM 1 for each withdrawal greater than or equal to RM 4 is added to the base class variable that holds the monthly service charges. Note: check the account balance after applying the service charge. If the balance become lower than RM 25, the account becomes inactive again. To set the required data. It may be parameterized or user's input. A virtual function used to accept an argument for the amount to be deposited. It should add the argument (amount) to the account balance. It should also increment the variable used to track the number of deposits. A virtual function used to accept an argument for the withdraw amount operation. It should subtract the argument from the account balance. It should also increment the used to track the number of withdrawals. A virtual function which calculates the monthly interest of the account and then updates the account balance by adding it to the principal amount. Note: Use the standard formulas/operations (monthly interest calculation) to implement this function. A virtual function which calls the calculateInterest function, subtracts the monthly service charges from the balance, and then sets the corresponding variables such as no. of withdrawals, no. of deposits, monthly service charges and so on. A member function used to display the monthly statistics of the account such as deposit, withdrawals, service charges, balance etc. calculateInterest monthlyProcessing getMonthlyStatistics

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions

Question

Describe a process for merging two max priority queues in O(n).

Answered: 1 week ago