Question

In: Computer Science

Banks offer various types of accounts, such as savings, checking, certificate of deposits, and money market,...

Banks offer various types of accounts, such as savings, checking, certificate of deposits, and money market, to attract customers as well as meet with 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 have a 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 higher 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. Penalty for early withdrawal is stiff. serviceChargeChecking: A service charge checking account is a checking account. Therefore, it inherits all the properties of a checking account. For simplicity, assume that this type of account does not pay any interest, allows the account holder to write a limited number of checks each month, and does not require any minimum balance. Include appropriate named constants, instance variables, and functions in this class. noServiceChargeChecking: A checking account with no monthly service charge is a checking account. Therefore, it inherits all the properties of a checking account. Furthermore, this type of account pays interest, allows the account holder to write checks, and requires a minimum balance. highInterestChecking: A checking account with high interest is a checking account with no monthly service charge. Therefore, it inherits all the properties of a no service charge checking account. Furthermore, this type of account pays higher interest and requires a higher minimum balance than the no service charge checking account. savingsAccount: A savings account is a bank account. Therefore, it inherits all the properties of a bank account. Furthermore, a savings account also pays interest. highInterestSavings: A high-interest savings account is a savings account. Therefore, it inherits all the properties of a savings account. It also requires a minimum balance. certificateOfDeposit: A certificate of deposit account is a bank account. Therefore, it inherits all the properties of a bank account. In addition, it has instance variables to store the number of CD maturity months, interest rate, and the current CD month. Write the definitions of the classes described in this programming exercise and a program to test your classes.

Solutions

Expert Solution

bankAccount.h

#ifndef H_bankAccount
#define H_bankAccount

#include <iostream>
#include <iomanip>
#include <string>

using namespace std;

class bankAccount // abstract class
{
public:
// constructor
bankAccount(int acctNum, string name, double initialBalance);

// accesors
string get_Name();
int get_AcctNumber();
double get_Balance();

// function
void deposit(double amount);

// pure virtual functions
virtual void withdraw(double amount) = 0;
virtual void printStatement() = 0;

// virtual function
virtual void printSummary()
{
       // formats the output correctly
          cout << setw(60) << setfill('-') << "" << setfill(' ') << endl;
          cout << endl << setw(25) << "" << "Account Summary" << endl << endl;
          cout << setw(25) << "Name: " << m_Name << endl;
          cout << setw(25) << "Account #: " << m_AcctNumber << endl;
          cout << setw(25) << "Current Balance: $" << m_Balance << endl;
}

protected:
// variables
string m_Name;
int m_AcctNumber;
double m_Balance;
};// end of abstract class
#endif // !H_bankAccount

bankAccount.cpp


#include "bankAccount.h"
#include <iostream>
#include <iomanip>
#include <string>

using namespace std;


   bankAccount::bankAccount(int acctNum, string name, double initialBalance) // constructor
   {
       m_AcctNumber = acctNum;
       m_Name = name;
       m_Balance = initialBalance;
   }

   string bankAccount::get_Name() // accesor to retrieve bank account name
   {
       return m_Name;
   }

   int bankAccount::get_AcctNumber() // accesor to retrieve bank account number
   {
       return m_AcctNumber;
   }

   double bankAccount::get_Balance() // accesor to retrieve bank account ballance
   {
       return m_Balance;
   }

   void bankAccount::deposit(double amount) // function to add a certain amount to the total deposit
   {
       m_Balance += amount;
       cout << "$" << amount << " has been deposited to your account" << endl;
   }


certificationOfDeposit.h


#ifndef H_certificateOfDeposit
#define H_certificateOfDeposit

#include "bankAccount.h"

class certificateOfDeposit : public bankAccount // inheriting bankAccount as public
{
public:
// constructor
certificateOfDeposit(int acctNum, string name, double initialBalance, int matMon);

// functions
void withdraw(double amount);
void printSummary();
void printStatement();

private:
// variables
double m_InterestRate;
int m_MaturityMonths;
int m_CurrentMonth;
}; // end of class
#endif // !H_certificateOfDeposit


certificateOfDeposit.cpp


#include "certificateOfDeposit.h"

certificateOfDeposit::certificateOfDeposit(int acctNum, string name, double initialBalance, int matMon) // default constructor that calls the parant class constructor
   : bankAccount(acctNum, name, initialBalance) // parent classes' default constructor is called
{
   // variables
   m_MaturityMonths = matMon;
   m_CurrentMonth = 1;
   m_InterestRate = 4.75;
}

void certificateOfDeposit::withdraw(double amount) // function to withdraw money from balance
{
   if (m_Balance - amount < 0) // checks to see if the balance will not be zero if money is withdrawned
   {
       cout << "Declined: Insufficient funds remain to withdraw that amount" << endl; // true statment is trigered
       return;
   }
   m_Balance -= amount; // withdraws money if the if statement is not true
}

void certificateOfDeposit::printSummary() // prints a summary of the account
{
   // Use parent class to print standard info
   bankAccount::printSummary(); // calls the parent classes' printSummary function
   // formats the rest of the info correctly
   cout << setw(25) << "Interest rate: " << m_InterestRate << "%" << endl;
   cout << setw(25) << "Maturity Months: " << m_MaturityMonths << endl;
   cout << setw(25) << "Current Month: " << m_CurrentMonth << endl;
   cout << endl << setw(60) << setfill('-') << "" << setfill(' ') << endl;
}

void certificateOfDeposit::printStatement() // prints a monthly statement of the account
{
   printSummary();
}

highInterestChecking.h


#ifndef H_highInterestChecking
#define H_highInterestChecking

#include "noServiceChargeChecking.h"

class highInterestChecking :
public noServiceChargeChecking // inheriting noServiceChargeChecking as public
{
public:
   // only has constructor due to this class only modifying the already created variables in the parant class
   highInterestChecking(int acctNum, string name, double initialBalance);
}; // end of class
#endif // !H_highInterestChecking

highInterestSavings.cpp


#include "highInterestSavings.h"

highInterestSavings::highInterestSavings(int acctNum, string name, double initialBalance) // default cunstructor
   : savingsAccount(acctNum, name, initialBalance) // calling the parent classes' default constructor
{
   m_MinimumBalance = 5000; // sets the minimum balance to 5000
}

void highInterestSavings::withdraw(double amount)
{
   if (m_Balance - amount < 0) // checks to see if the balance will not be below zero if withdrawing
   {
       cout << "Declined: Insufficient funds remain to withdraw that amount" << endl; // true statemant is trigered
       return;
   }

   if (m_Balance - amount < m_MinimumBalance) // checks to see if the balance will not be below the 5000 minimum
   {
       cout << "Declined: Minimum balance requirement prohibits this withdrawal" << endl; // true statemant is trigered
       return;
   }

   m_Balance -= amount; // withdraws money if if statemants are not trigered
}

void highInterestSavings::printSummary()
{
   // Uses the already created parents classes print function for standard information
   bankAccount::printSummary(); // calling bankAccount's print function
   // formats the output corectly for the new information
   cout << setw(25) << "Interest rate: " << m_InterestRate << "%" << endl;
   cout << setw(25) << "Minimum Balance: $" << m_MinimumBalance << endl << endl;
   cout << setw(60) << setfill('-') << "" << setfill(' ') << endl;
}

noServiceChargeChecking.h


#ifndef H_noServiceChargeChecking
#define H_noServiceChargeChecking

#include "checkingAccount.h"

class noServiceChargeChecking :
public checkingAccount
{
public:
// constructor
noServiceChargeChecking(int acctNum, string name, double initialBalance);

// functions
void writeCheck(double amount);
void printSummary();

};
#endif // !H_noServiceChargeChecking

noServiceChargeChecking.cpp


#include "noServiceChargeChecking.h"

noServiceChargeChecking::noServiceChargeChecking(int acctNum, string name, double initialBalance) // default constructor
   : checkingAccount(acctNum, name, initialBalance) // callin the parents default cunstructor
{
   m_InterestRate = 2.5; // Some interest rate
   m_ChecksRemaining = -1; // -1 indicates no limit
   m_MinimumBalance = 500; // Minimum balance

}

void noServiceChargeChecking::writeCheck(double amount)
{
   if (m_Balance - amount < 0) // checks to see if balance will be below zero if money is withdrawned
   {
       cout << "Declined: Insufficient funds remain to withdraw that amount" << endl; // true statemant is trigered
       return;
   }

   m_Balance -= amount; // Assume check is cashed immediately
}

void noServiceChargeChecking::printSummary()
{
   // uses parants class print function for standard info
   bankAccount::printSummary(); // calls the parants classes' printSummary function
   // formats new info corectly for output
   cout << setw(25) << "Interest rate: " << m_InterestRate << "%" << endl;
   cout << setw(25) << "Minimum Balance: $" << m_MinimumBalance << endl;
   cout << setw(25) << "Unlimited checks   " << endl;
   cout << setw(25) << "No monthly service fee   " << endl;
   cout << setw(60) << setfill('-') << "" << setfill(' ') << endl;
}

savingsAccount.h


#ifndef H_savingsAccount
#define H_savingsAccount

#include "bankAccount.h"

class savingsAccount :
public bankAccount // inherits bankAccount as public
{
public:
   // constructor
   savingsAccount(int acctNum, string name, double initialBalance);

   // functions
   void withdraw(double amount);
   void printSummary();
   void printStatement();


protected:
double m_InterestRate;

};
#endif // !H_savingsAccount

savingsAccount.cpp


#include "savingsAccount.h"

savingsAccount::savingsAccount(int acctNum, string name, double initialBalance) // default constructor
   : bankAccount(acctNum, name, initialBalance) // calls the default constructor of the parant class
{
   m_InterestRate = 3.99; // sets the default interest rate to 3.99
}

void savingsAccount::withdraw(double amount)
{
   if (m_Balance - amount < 0) // checks to see if the balance will be below zero when money is withdrawned
   {
       cout << "Declined: Insufficient funds remain to withdraw that amount" << endl; // true statemant is trigered
       return;
   }
   m_Balance -= amount; // withdraws money from balance if if statemants are not triggered
}

void savingsAccount::printSummary()
{
   // Uses the parants classes print function for the standard info
   bankAccount::printSummary(); // calls the parants classes print function
   // formats the new information correctly
   cout << setw(25) << "Interest rate: " << m_InterestRate << "%" << endl << endl;
   cout << setw(60) << setfill('-') << "" << setfill(' ') << endl;
}

void savingsAccount::printStatement() // prints the monthly statement
{
   printSummary();
}


serviceChargeChecking.h


#ifndef H_serviceChargeChecking
#define H_serviceChargeChecking

#include "checkingAccount.h"

class serviceChargeChecking :
public checkingAccount // inherits checkingAccount as public
{
public:
// constructor
serviceChargeChecking(int acctNum, string name, double initialBalance);

// functions
void writeCheck(double amount);
void printSummary();
};
#endif // !H_serviceChargeChecking

serviceChargeChecking.cpp


#include "serviceChargeChecking.h"

const int MAX_CHECKS = 5; // sets the max amount of checks that can be written
const double SVC_CHARGE = 10.0l; // monthly service fee

serviceChargeChecking::serviceChargeChecking(int acctNum, string name, double initialBalance) // default constructor
   : checkingAccount(acctNum, name, initialBalance) // calling the constructor of the parant class
{
   m_InterestRate = 0; // No interest
   m_ChecksRemaining = MAX_CHECKS; // Limit of 5 checks
   m_MinimumBalance = 0; // No minimum balance
}

void serviceChargeChecking::writeCheck(double amount) // function to write a check that will be cashed later on
{
   if (m_ChecksRemaining == 0) // checks to see if there are any remain checks
   {
       cout << "Declined: No more checks remaining this month" << endl; // true statemant trigered
       return;
   }

   if (m_Balance - amount < 0) // checks to see if the balance will be below zero when a check is written
   {
       cout << "Declined: Insufficient funds remain to withdraw that amount" << endl; // true statemant trigered
       return;
   }

   m_ChecksRemaining--; // one check is removed if there are remaining checks
   m_Balance -= amount; // balance goes down when the check is cashed

}

void serviceChargeChecking::printSummary()
{
   // Uses parants classes' print functions for the basic info
   bankAccount::printSummary(); // calls the parants classes printSummary function
   // correctly formats the output of the new data
   cout << setw(25) << "Checks remaining: " << m_ChecksRemaining << endl;
   cout << setw(25) << "Monthly service fee: $" << SVC_CHARGE << endl;
   cout << setw(25) << "No interest " << endl;
   cout << setw(25) << "No Minimum Balance " << endl;
   cout << setw(60) << setfill('-') << "" << setfill(' ') << endl;
}

main.cpp


#include <iostream>
#include <iomanip>
#include <string>

#include "bankAccount.h"
#include "checkingAccount.h"
#include "serviceChargeChecking.h"
#include "noServiceChargeChecking.h"
#include "highInterestChecking.h"
#include "savingsAccount.h"
#include "highInterestSavings.h"
#include "certificateOfDeposit.h"

using namespace std;

void TestCheckingWithService()
{
serviceChargeChecking acct(123,"John Doe", 1000); // creates a object from serviceChargeChecking

char input=0; // user input
double amount; // user money amount
cout << "\t\tTesting Checking with Service Charge" << endl << endl;

cout << "Current account overview:" << endl;
acct.printSummary(); // calls printSummary of the objects class
cout << endl;

while (input != 'x') // loop will continue until user enters x to exit the program. users input will call the function of the objects parent's class if not x.
{
    cout << "Select a transaction:" << endl;
    cout << "1 - Make a Withdrawal" << endl;
    cout << "2 - Make a Deposit" << endl;
    cout << "3 - Print Summary" << endl;
    cout << "4 - Print Monthly Statement" << endl;
    cout << "5 - Write a check" << endl;
    cout << "x - Exit Program" << endl;
    cout << "Enter choice: ";
    cin >> input;

    switch (input) // switch case to determine what the user wants to do.
    {
    case '1':
      cout << "Enter amount: ";
      cin >> amount;
      acct.withdraw(amount);
      break;
    case '2':
      cout << "Enter amount: ";
      cin >> amount;
      acct.deposit(amount);
      break;
    case '3':
      acct.printSummary();
      break;
    case '4':
      acct.printStatement();
      break;
    case '5':
      cout << "Enter amount: ";
      cin >> amount;
      acct.writeCheck(amount);
      break;
    case '6':
      break;
    case 'x':
      break;
    default:
      cout << "Invalid choice" << endl;
      break;
    }
    acct.printSummary();
    cout << endl;
}
}

void TestCheckingNoService()
{
noServiceChargeChecking acct(123,"John Doe", 1000); // creates a object from noServiceChargeChecking
char input=0; // user input
double amount; // user money amount
cout << "\t\tTesting Checking without Service Charge" << endl << endl;

cout << "Current account overview:" << endl;
acct.printSummary(); // calls printSummary of the objects class
cout << endl;

while (input != 'x') // loop will continue until user enters x to exit the program. users input will call the function of the objects parent's class if not x.
{
    cout << "Select a transaction:" << endl;
    cout << "1 - Make a Withdrawal" << endl;
    cout << "2 - Make a Deposit" << endl;
    cout << "3 - Print Summary" << endl;
    cout << "4 - Print Monthly Statement" << endl;
    cout << "5 - Write a check" << endl;
    cout << "x - Exit Program" << endl;
    cout << "Enter choice: ";
    cin >> input;

    switch (input) // switch case to determine what the user wants to do.
    {
    case '1':
      cout << "Enter amount: ";
      cin >> amount;
      acct.withdraw(amount);
      break;
    case '2':
      cout << "Enter amount: ";
      cin >> amount;
      acct.deposit(amount);
      break;
    case '3':
      acct.printSummary();
      break;
    case '4':
      acct.printStatement();
      break;
    case '5':
      cout << "Enter amount: ";
      cin >> amount;
      acct.writeCheck(amount);
      break;
    case '6':
      break;
    case 'x':
      break;
    default:
      cout << "Invalid choice" << endl;
      break;
    }
    acct.printSummary();
    cout << endl;
}

}

void TestCheckingHighInterest()
{
highInterestChecking acct(123,"John Doe", 1000); // creates a object from highInterestChecking

char input=0; // user input
double amount; // user money amount
cout << "\t\tTesting Checking with High Interest" << endl << endl;

cout << "Current account overview:" << endl;
acct.printSummary(); // calls printSummary of the objects class
cout << endl;

while (input != 'x') // loop will continue until user enters x to exit the program. users input will call the function of the objects parent's class if not x.
{
    cout << "Select a transaction:" << endl;
    cout << "1 - Make a Withdrawal" << endl;
    cout << "2 - Make a Deposit" << endl;
    cout << "3 - Print Summary" << endl;
    cout << "4 - Print Monthly Statement" << endl;
    cout << "5 - Write a check" << endl;
    cout << "x - Exit Program" << endl;
    cout << "Enter choice: ";
    cin >> input;

    switch (input) // switch case to determine what the user wants to do.
    {
    case '1':
      cout << "Enter amount: ";
      cin >> amount;
      acct.withdraw(amount);
      break;
    case '2':
      cout << "Enter amount: ";
      cin >> amount;
      acct.deposit(amount);
      break;
    case '3':
      acct.printSummary();
      break;
    case '4':
      acct.printStatement();
      break;
    case '5':
      cout << "Enter amount: ";
      cin >> amount;
      acct.writeCheck(amount);
      break;
    case '6':
      break;
    case 'x':
      break;
    default:
      cout << "Invalid choice" << endl;
      break;
    }
    acct.printSummary();
    cout << endl;
}
}

void TestSavings()
{
savingsAccount acct(123,"John Doe", 1000); // creates a object from savingsAccount

char input=0; // user input
double amount; // user money amount
cout << "\t\tTesting Regular Savings" << endl << endl;

cout << "Current account overview:" << endl;
acct.printSummary(); // calls printSummary of the objects class
cout << endl;

while (input != 'x') // loop will continue until user enters x to exit the program. users input will call the function of the objects parent's class if not x.
{
    cout << "Select a transaction:" << endl;
    cout << "1 - Make a Withdrawal" << endl;
    cout << "2 - Make a Deposit" << endl;
    cout << "3 - Print Summary" << endl;
    cout << "4 - Print Monthly Statement" << endl;
    cout << "x - Exit Program" << endl;
    cout << "Enter choice: ";
    cin >> input;

    switch (input) // switch case to determine what the user wants to do.
    {
    case '1':
      cout << "Enter amount: ";
      cin >> amount;
      acct.withdraw(amount);
      break;
    case '2':
      cout << "Enter amount: ";
      cin >> amount;
      acct.deposit(amount);
      break;
    case '3':
      acct.printSummary();
      break;
    case '4':
      acct.printStatement();
      break;
    case 'x':
      break;
    default:
      cout << "Invalid choice" << endl;
      break;
    }
    acct.printSummary();
    cout << endl;
}
}

void TestSavingsHighInterest()
{
highInterestSavings acct(123,"John Doe", 8000); // creates a object from highInterestSavings

char input=0; // user input
double amount; // user money amount
cout << "\t\tTesting High Interest Savings" << endl << endl;

cout << "Current account overview:" << endl;
acct.printSummary(); // calls printSummary of the objects class
cout << endl;

while (input != 'x') // loop will continue until user enters x to exit the program. users input will call the function of the objects parent's class if not x.
{
    cout << "Select a transaction:" << endl;
    cout << "1 - Make a Withdrawal" << endl;
    cout << "2 - Make a Deposit" << endl;
    cout << "3 - Print Summary" << endl;
    cout << "4 - Print Monthly Statement" << endl;
    cout << "x - Exit Program" << endl;
    cout << "Enter choice: ";
    cin >> input;

    switch (input) // switch case to determine what the user wants to do.
    {
    case '1':
      cout << "Enter amount: ";
      cin >> amount;
      acct.withdraw(amount);
      break;
    case '2':
      cout << "Enter amount: ";
      cin >> amount;
      acct.deposit(amount);
      break;
    case '3':
      acct.printSummary();
      break;
    case '4':
      acct.printStatement();
      break;
    case 'x':
      break;
    default:
      cout << "Invalid choice" << endl;
      break;
    }
    acct.printSummary();
    cout << endl;
}
}

void TestCertificateOfDeposit()
{
certificateOfDeposit acct(123,"John Doe", 10000, 6); // creates a object from certificateOfDeposit

char input=0; // user input
double amount; // user money amount
cout << "\t\tTesting High Interest Savings" << endl << endl;

cout << "Current account overview:" << endl;
acct.printSummary(); // calls printSummary of the objects class
cout << endl;

while (input != 'x') // loop will continue until user enters x to exit the program. users input will call the function of the objects parent's class if not x.
{
    cout << "Select a transaction:" << endl;
    cout << "1 - Make a Withdrawal" << endl;
    cout << "2 - Make a Deposit" << endl;
    cout << "3 - Print Summary" << endl;
    cout << "4 - Print Monthly Statement" << endl;
    cout << "x - Exit Program" << endl;
    cout << "Enter choice: ";
    cin >> input;

    switch (input) // switch case to determine what the user wants to do.
    {
    case '1':
      cout << "Enter amount: ";
      cin >> amount;
      acct.withdraw(amount);
      break;
    case '2':
      cout << "Enter amount: ";
      cin >> amount;
      acct.deposit(amount);
      break;
    case '3':
      acct.printSummary();
      break;
    case '4':
      acct.printStatement();
      break;
    case 'x':
      break;
    default:
      cout << "Invalid choice" << endl;
      break;
    }
    acct.printSummary();
    cout << endl;
}
}

int main()
{
char input; // user's input
cout << "\t\tWelcome to the testing Bank" << endl << endl;

cout << "WWhich account do you want?" << endl;
cout << "1 - Checking with Service Charge" << endl;
cout << "2 - Checking without Service Charge" << endl;
cout << "3 - Checking with High Interest" << endl;
cout << "4 - Savings" << endl;
cout << "5 - Savings with High Interest" << endl;
cout << "6 - Certificate of Deposit" << endl;
cout << "Enter choice: ";
cin >> input;

switch (input) // switch case to determine which account type the user wants
{
case '1':
    TestCheckingWithService();
    break;
case '2':
    TestCheckingNoService();
    break;
case '3':
    TestCheckingHighInterest();
    break;
case '4':
    TestSavings();
    break;
case '5':
    TestSavingsHighInterest();
    break;
case '6':
    TestCertificateOfDeposit();
    break;
default:
    cout << "Invalid choice" << endl;
    break;
}
}

highInterestChecking.cpp


#include "highInterestChecking.h"

highInterestChecking::highInterestChecking(int acctNum, string name, double initialBalance)
   : noServiceChargeChecking(acctNum, name, initialBalance) // modifies the parants classes interest rate and minimun balance
{
   // variables
   m_InterestRate = 5.0; // Higher interest rate
   m_ChecksRemaining = -1; // -1 indicates no limit
   m_MinimumBalance = 1000; // Minimum balance
}

checkingAccount.cpp


#include "checkingAccount.h"

checkingAccount::checkingAccount(int acctNum, string name, double initialBalance) // default contructor
   : bankAccount(acctNum, name, initialBalance)
{
   // due to this class being abstract, it will not be called to create a object
}


void checkingAccount::withdraw(double amount)
{
   if (m_Balance - amount < 0) // checks to see if the account balance will not be below zero to withdraw money
   {
       cout << "Declined: Insufficient funds remain to withdraw that amount" << endl; // true statemant is trigered
       return;
   }

   if (m_Balance - amount < m_MinimumBalance) // checks to see if the balance will not be below the minium balance when withdrawing
   {
       cout << "Declined: Minimum balance requirement prohibits this withdrawal" << endl; // true statemant is trigered
       return;
   }
   m_Balance -= amount; // withdraws money if if statemant were not trigered
}

void checkingAccount::printStatement() // prints monthly statemant of account
{
   printSummary();
   cout << endl << "printStatement is not implemented in the program" << endl << endl;
}

checkingAccount.h


#ifndef H_checkingAccount
#define H_checkingAccount

#include "bankAccount.h"

class checkingAccount :
   public bankAccount // inheriting bankAccount as public
{
public:
   // constructor
   checkingAccount(int acctNum, string name, double initialBalance);
  
   // functions
   void withdraw(double amount);
   void printStatement();

   // pure virtual function
   virtual void writeCheck(double amount) = 0;

protected:
   // variables
   double m_InterestRate;
   int m_ChecksRemaining;
   double m_MinimumBalance;
}; // end of abstract class
#endif // !H_checkingAccount

highInterestSavings.h

#ifndef H_highInterestSavings
#define H_highInterestSavings

#include "savingsaccount.h"

class highInterestSavings :
public savingsAccount // inheriting savingsAccount as public
{
public:
// cunstructor
highInterestSavings(int acctNum, string name, double initialBalance);

   // functions
void withdraw(double amount);
void printSummary();


protected:
// variable
double m_MinimumBalance;

}; // end of class
#endif // !H_highInterestSavings


Related Solutions

Banks offer various types of accounts, such as savings, checking, certificate of deposits, and money market,...
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 have a checking account that limits the number of checks you may write. Another...
Banks offer various types of accounts, such as savings, checking, certificate of deposits, and money market,...
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 have a checking account that limits the number of checks you may write. Another...
Problem Statement: Banks offer various types of accounts, such as savings, checking, certificate of deposits, and...
Problem Statement: Banks offer various types of accounts, such as savings, checking, certificate of deposits, and money market, to attract customers as well as meet with 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 have a checking account that limits the number of checks you...
C++ 7th edition Banks offer various types of accounts, such as savings, checking, certificate of deposits,...
C++ 7th edition 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 have a checking account that limits the number of checks you...
Four different banks in town offer savings accounts that all pay a stated or quoted rate...
Four different banks in town offer savings accounts that all pay a stated or quoted rate of 2.5%. However, each bank compounds interest paid on the account differently. If you want to save money in one of these banks, which do you pick? The one that compounds: a. annually b. monthly c. quarterly d. weekly e. it does not make a difference because they all pay 2.5%
Assets Liabilities Reserves 250 Deposits   Required __     Transaction (checking) deposits 1000   Excess __      Savings deposits 3000...
Assets Liabilities Reserves 250 Deposits   Required __     Transaction (checking) deposits 1000   Excess __      Savings deposits 3000 Loans    Money Market deposits 500     Variable rate loans 750 Time deposits (CDs)     Short-term loans 1600     Fixed rate 500    Long-term fixed rate loans    2000     Variable rate 100 Securities Borrowing    Short-term securities 500     Fed funds borrowed 0    Long-term securities 600 a) Refer to the bank balance sheet above. Suppose values are in millions of dollars. Suppose return on assets (ROA) is 1.2%. Suppose bank owners convince...
Brian and Felicia deposit money into separate savings accounts today. Brian deposits X into his account,...
Brian and Felicia deposit money into separate savings accounts today. Brian deposits X into his account, while Felicia deposits (x/2) . Brian's account earns simple interest at an annual rate of j > 0. Felicia's account earns interest at a nominal annual rate of j, compounded quarterly. Brian and Felicia earn the same amount of interest during the last quarter of the 4th year. Calculate j.
Julie and Ron deposit money into separate savings accounts today. Julie deposits X into his account,...
Julie and Ron deposit money into separate savings accounts today. Julie deposits X into his account, while Ron deposits X/2 . Julie’s account earns simple interest at an annual rate of j > 0. Ron's account earns interest at a nominal annual rate of j, compounded quarterly. Julie and Ron earn the same amount of interest during the last quarter of the 4th year. Calculate j.
C++ Language Oriented program. Please help me out with this project !!! Banks offer various types...
C++ Language Oriented program. Please help me out with this project !!! 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 have a...
What are the major types of deposits plans that depository institutions offer today?
What are the major types of deposits plans that depository institutions offer today?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT