Question: C++ Help. PLEASE include detailed comments and explanations. PLEASE follow the drections exactly. Thank you. Define a class with the name BankAccount and the following

C++ Help. PLEASE include detailed comments and explanations. PLEASE follow the drections exactly. Thank you.

Define a class with the name BankAccount and the following members:

Data Members:

accountBalance: balance held in the account

interestRate: annual interest rate.

accountID: unique 3 digit account number assigned to each BankAccount object. Use a static data member to generate this unique account number for each BankAccount

count: A static data member to track the count of the number of BankAccount objects created.

Member Functions

void withdraw(double amount): function which withdraws an amount from accountBalance

void deposit(double amount): function which deposits an amount to the accountBalance.

void calculateMonthlyInterest( ): function which calculates the monthly interest and adds to accountBalance

void displayAccountInfo( ): function which displays the accountID, accountBalance, interestRate and count of the number of BankAccounts created.

Define the derived classes CheckingAccount and SavingsAccount from BankAccount with the following interest rates:

const double DEFAULT_INTEREST_RATE_CHECKING = 0.04;

const double DEFAULT_INTEREST_RATE_SAVINGS = 0.06;

If the AccountBalance of the CheckingAccount falls below $500 then a fee

of $50 is charged to the account.

const double DEFAULT_FEE_CHECKING = 50.0;

Use the following driver to validate your program:

#include

#include

#include "SavingsAccount.h"

#include "CheckingAccount.h"

using namespace std;

int main()

{

CheckingAccount jackAccount(1000);

CheckingAccount lisaAccount(450);

SavingsAccount samirAccount(9300);

SavingsAccount ritaAccount(32);

jackAccount.deposit(1000);

lisaAccount.deposit(2300);

samirAccount.deposit(800);

ritaAccount.deposit(500);

jackAccount.calculateMonthlyInterest();

lisaAccount.calculateMonthlyInterest();

samirAccount.calculateMonthlyInterest();

ritaAccount.calculateMonthlyInterest();

cout << "***********************************" << endl;

jackAccount.displayAccountInfo();

lisaAccount.displayAccountInfo();

samirAccount.displayAccountInfo();

ritaAccount.displayAccountInfo();

cout << "***********************************" << endl << endl;

jackAccount.withDraw(250);

lisaAccount.withDraw(350);

samirAccount.withdraw(120);

ritaAccount.withdraw(290);

cout << "********After withdrawals ***************" << endl;

jackAccount.displayAccountInfo();

lisaAccount.displayAccountInfo();

samirAccount.displayAccountInfo();

ritaAccount.displayAccountInfo();

cout << "***********************************" << endl << endl;

system("pause");

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!