Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This lab introduces you to writing a C++ program to implement the concept of cla

ID: 3628680 • Letter: T

Question

This lab introduces you to writing a C++ program to implement the concept of class inheritance using different types of bank accounts as a model. In this lab, you will create a base class, called CBankAccount, and two additional classes (each derived from CBankAccount), called CSavingsAccount and CCheckingAccount. You will then test the operations of each class in function main() to simulate the transactions of both a checking account and a savings account.

 



Create a new
project that consists of the base class BankAccount.



The BankAccount class
should contain, at minimum, the following members.





Below is the Sourcecode Skeleton
//bankAccount.h

#pragma once
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;

class BankAccount
{
private:
double balance;
string accntNum;
public:
void setAccntNum( );
string getAccntNum( );
void setBalance( );
double getBalance( );
void makeDeposit( );
void makeWithdrawal( );
};

class CheckingAccount: public BankAccount
{
private:
int numWithdrawals;
bool insufficientFunds;
public:
void makeDeposit( );
void makeWithdrawal( );
void transactionReport( );
};

class SavingsAccount: public BankAccount
{
private:
double interestRate;
int daysSinceLastTransaction;
double interestEarned;
bool insufficientFunds;
public:
void makeWithdrawal( );
double getBalance( );
void transactionReport( );
void setInterestRate(double rate);
void setInterestRate( );
double getInterestRate( );
int getDaysLastTransaction( );
};



//bankAccount.cpp

#include "BankAccount.h"

void BankAccount::setAccntNum()
{

}

string BankAccount::getAccntNum()
{
return "123-456-7890";
}

void BankAccount::setBalance()
{

}

double BankAccount::getBalance()
{
return 1000.00;
}

void BankAccount::makeDeposit()
{

}

void BankAccount::makeWithdrawal()
{

}

// class CheckingAccount : public BankAccount Member Functions
void CheckingAccount::makeDeposit()
{

}

void CheckingAccount::makeWithdrawal()
{

}

void CheckingAccount::transactionReport()
{

}



// class SavingsAccount : public BankAccount Member Functions
void SavingsAccount::makeWithdrawal()
{

}

double SavingsAccount::getBalance()
{
return 1000.00;
}

void SavingsAccount::setInterestRate()
{

}
double SavingsAccount::getInterestRate()
{
return 10; //percent
}

int SavingsAccount::getDaysLastTransaction()
{
return 10;
}

void SavingsAccount::transactionReport()
{

}


//bankAccountMain.cpp

#include "BankAccount.h"


void main()
{
CheckingAccount checking;
SavingsAccount savings;


}

Explanation / Answer

Please Click Here to getCOMP 220 Week 3 (iLab 3 of 7: Inheritance)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote