Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Any help is greatly appreciated i've been stuck on this a while! 1 . Define the class bankAccount to store a bank customer s account
Any help is greatly appreciated i've been stuck on this a while!
Define the class bankAccount to store a bank customers account number and balance. Suppose that account number is of type int, and balance is of type double. Your class should, at least, provide the following operations: set the account number, retrieve the account number, retrieve the balance, deposit and withdraw money, and print account information. Add appropriate constructors.
Every bank offers a checking account. Derive the class checkingAccount from the class bankAccount designed in part This class inherits members to store the account number and the balance from the base class. A customer with a checking account typically receives interest, maintains a minimum balance, and pays service charges if the balance falls below the minimum balance. Add member variables to store this additional information. In addition to the operations inherited from the base class, this class should provide the following operations: set interest rate, retrieve interest rate, set minimum balance, retrieve minimum balance, set service charges, retrieve service charges, post interest, verify if the balance is less than the minimum balance, write a check, withdraw override the method of the base class and print account information. Add appropriate constructors.
Every bank offers a savings account. Derive the class savingsAccount from the class bankAccount designed in part This class inherits members to store the account number and the balance from the base class. A customer with a savings account typically receives interest, makes deposits, and withdraws money. In addition to the operations inherited from the base class, this class should provide the following operations: set interest rate, retrieve interest rate, post interest, withdraw override the method of the base class and print account information. Add appropriate constructors.
Write a program to test your classes designed in parts and
Since your program handles currency, make sure to use a data type that can store decimals with a decimal precision of
There are seven files that need to work together maincpp bankAccount.cpp bankAccount.h checkingAccount.cpp checkingAccount.h savingsAccount.cpp savingsAccount.h
Here are the three given files:
bankAccounth
#ifndef HbankAccount
#define HbankAccount
class bankAccount
public:
void setAccountNumberint acct;
int getAccountNumber const;
double getBalance const;
void withdrawdouble amount;
void depositdouble amount;
void print const;
bankAccountint acctNumber double bal ;
protected:
int accountNumber;
double balance;
;
#endif
checkingAccounth
#ifndef HcheckingAccount
#define HcheckingAccount
#include "bankAccount.h
const double DEFAULTINTERESTRATECHECKING ;
const double DEFAULTMINBALANCE ;
const double DEFAULTSERVICECHARGE ;
class checkingAccount: public bankAccount
public:
double getMinimumBalance const;
void setMinimumBalancedouble minBalance;
double getInterestRate const;
void setInterestRatedouble intRate;
double getServiceCharge const;
void setServiceChargedouble intRate;
void postInterest;
bool verifyMinimumumBalancedouble amount;
void checkingAccount::writeCheckdouble amount;
void withdrawdouble amount;
void print const;
checkingAccountint acctNumber, double bal,
double minBal DEFAULTMINBALANCE,
double intRate DEFAULTINTERESTRATECHECKING,
double servC DEFAULTSERVICECHARGE;
protected:
double interestRate;
double minimumBalance;
double serviceCharge;
;
#endif
savingsAccounth
#ifndef HsavingsAccount
#define HsavingsAccount
#include "bankAccount.h
const double DEFAULTINTERESTRATESAVINGS ;
class savingsAccount: public bankAccount
public:
double getInterestRate const;
void setInterestRatedouble rate;
void withdrawdouble amount;
void postInterest;
void savingsAccount::print const;
savingsAccountint acctNumber, double bal,
double intRate DEFAULTINTERESTRATESAVINGS;
protected:
double interestRate;
;
#endif
I need help with main.cpp bankAccount.cpp checkingAccount.cpp and savingsAccount.cpp
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started