C++, using Visual Studio Banks offer various types of accounts, such as savings,
ID: 3872689 • Letter: C
Question
C++, using Visual Studio Banks offer various types of accounts, such as savings, checking, certificate of deposits, and money market, to attract customers as well as meet their specific needs. Two of the most commonly used accounts are savings and checking. Each of these accounts has various options. For example, you may have a savings account that requires no minimum balance but has a lower interest rate. Similarly, you may havea checking account that limits the number of checks you may write. Another type of account that is used to save money for the long term is certificate of deposit (CD). In this programming exercise, you use abstract classes and pure virtual functions to design classes to manipulate various types of accounts. For simplicity assume that the bank offers three types of accounts: savings, checking and certificate of deposit, as described next. Savings accounts: Suppose that the bank offers two types of savings accounts: one that has no minimum balance and a lower interest rate and another that requires a minimum balance and has a higher interest rate. Checking accounts: Suppose that the bank offers three types of checking accounts: one with a monthly service charge, limited check writing, no minimum balance, and no interest; another with no monthly service charge, a minimum balance requirement, unlimited check writing and lower interest and a third with no monthly service charge, a highef minimum requirement, a higher interest rate, and unlimited check writing. Certificate of deposit (CD): In an account of this type, money is left for some time, and these accounts draw higher interest rates than savings or checking accounts. Suppose that you purchase a CD for six months. Then we say that the CD will mature in six months. The penalty for early withdrawal is stiff Figure 12-25 shows the inheritance hierarchy of these bank accounts. Note that the classes bankAccount and checkingAccount are abstract. That is, we cannot instantiate objects of these classes. The other classes in Figure 12-25 are not abstract bankAccount checkingAccountcertificateofDeposit savingsAccount serviceChargeChecki oServiceChargeChecking highInterestsavinge highInterest CheckingExplanation / Answer
#include<iostream.h>
#include<string.h>
class bankAccount
{
public:
int retrieveAccount_No();
double retrieveBalance();
string retrieveName();
void setCustomerName(string name_customer);
void withdraw_Amount(double acc_balance);
void deposit_Amount(double acc_balance);
abstract void MonthlyBankStatement();
private:
int acc_Number;
string name_customer;
double acc_balance;
}
class savingsAccount: public bankAccount
{
public:
void Check(double);
}
class checkAccount: public bankAccount //I have used the name of class as Checkaccount //instead of checkingAccount
{
public:
void Check( double acc_balance);
}
class ServiceChargeChecking: public checkAccount
{
public:
double retrieveServiceCharge();
void ServiceChargeSet();
double retrieveServiceChargeCheck();
void ServiceChargeCheckSet();
int retrieveNumber_of_WrittenChecks();
void numberOfCheckWrittenSet(int );
void Check();
private:
double ACC_SERVICE_AMOUNT= 10;
int MAX_NO_OF_CHECK = 5;
protected:
double serviceCostAcc;
double serviceCostCheck;
int number_CheckWritten;
}
class nilServiceChecking: public checkAccount
{
public:
double getMinBalance();
void getMinBalance(double);
void writeChecks(double);
void withdrawamount(double);
private:
double MINIMUM_BALANCE = 1000;
double RATE_OF_INTEREST= 0.02;
protected:
double minBalance;
double Rateofinterest;
}
class highInterestChecking: public nilServiceChecking
{
public:
double getRate_of_interest();
void setRate_of_Interest(double);
private:
double RATE_OF_INTEREST=0.04;
double MINIMUM_BALANCE=4000.00;
}
#include<iostream.h>
#include<string.h>
class bankAccount
{
public:
int retrieveAccount_No();
double retrieveBalance();
string retrieveName();
void setCustomerName(string name_customer);
void withdraw_Amount(double acc_balance);
void deposit_Amount(double acc_balance);
abstract void MonthlyBankStatement();
private:
int acc_Number;
string name_customer;
double acc_balance;
}
class savingsAccount: public bankAccount
{
public:
void Check(double);
}
class checkAccount: public bankAccount //I have used the name of class as Checkaccount //instead of checkingAccount
{
public:
void Check( double acc_balance);
}
class ServiceChargeChecking: public checkAccount
{
public:
double retrieveServiceCharge();
void ServiceChargeSet();
double retrieveServiceChargeCheck();
void ServiceChargeCheckSet();
int retrieveNumber_of_WrittenChecks();
void numberOfCheckWrittenSet(int );
void Check();
private:
double ACC_SERVICE_AMOUNT= 10;
int MAX_NO_OF_CHECK = 5;
protected:
double serviceCostAcc;
double serviceCostCheck;
int number_CheckWritten;
}
class nilServiceChecking: public checkAccount
{
public:
double getMinBalance();
void getMinBalance(double);
void writeChecks(double);
void withdrawamount(double);
private:
double MINIMUM_BALANCE = 1000;
double RATE_OF_INTEREST= 0.02;
protected:
double minBalance;
double Rateofinterest;
}
class highInterestChecking: public nilServiceChecking
{
public:
double getRate_of_interest();
void setRate_of_Interest(double);
private:
double RATE_OF_INTEREST=0.04;
double MINIMUM_BALANCE=4000.00;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.