Answered step by step
Verified Expert Solution
Question
1 Approved Answer
implement interest from deposit date till withdrawal date #include / / Included the header file for standard input and output #include / / Included the
implement interest from deposit date till withdrawal date
#include Included the header file for standard input and output
#include Included the header file for string Operations
#include Included the header file for vector class
#include iomanip is a library that is used to manipulate the output of C program
class Date
public:
int year, month, day;
Dateint y int m int d : yeary monthm dayd
std::string tostring const
return std::tostringyear std::tostringmonth std::tostringday;
;
class Transaction
std::string transactiontype;
float amount;
float balance;
Date date;
public:
Transactionstd::string type, float a float b Date d
: transactiontypetype amounta balanceb dated
std::string tostring const
return transactiontype date.tostring Amount: $ std::tostringamount Balance: $ std::tostringbalance;
;
class Customer
public:
std::string name;
std::string address;
int age;
std::string telephonenumber;
int customernumber;
virtual double getannualinterestrate const
return ;
Customerconst std::string& name, const std::string& address, int age, const std::string& phoneNumber, int id
: namename addressaddress ageage telephonenumberphoneNumber customernumberid
Accessors and Modifiers of Data Fields
std::string getname const return name;
std::string getaddress const return address;
int getage const return age;
std::string gettelephonenumber const return telephonenumber;
int getcustomernumber const return customernumber;
void setnameconst std::string& newname name newname;
void setaddressconst std::string& newaddress address newaddress;
void setageint newage age newage;
void settelephonenumberconst std::string& newtelephonenumber telephonenumber newtelephonenumber;
void setcustomernumberint newcustomernumber customernumber newcustomernumber;
virtual void dummyfunction const
;
class Senior : public Customer
public:
static const double SAVINGSINTEREST;
static const double CHECKINGINTEREST;
static const double CHECKCHARGE;
static const double OVERDRAFTPENALTY;
Seniorstd::string name, std::string address, int age, std::string phone, int custNum
: Customername address, age, phone, custNum Constructor and other member functions...
;
const double Senior::SAVINGSINTEREST ; annual rate
const double Senior::CHECKINGINTEREST ; annual rate. Yes! this is interest rate for the checking account.
const double Senior::CHECKCHARGE ; cents for withdrawal
const double Senior::OVERDRAFTPENALTY ; dollar
class Adult : public Customer
public:
static const double SAVINGSINTEREST;
static const double CHECKINGINTEREST;
static const double CHECKCHARGE;
static const double OVERDRAFTPENALTY;
Adultstd::string name, std::string address, int age, std::string phone, int custNum
: Customername address, age, phone, custNum
;
const double Adult::SAVINGSINTEREST ; annual rate
const double Adult::CHECKINGINTEREST ; annual rate. Yes! this is interest rate for the checking account.
const double Adult::CHECKCHARGE ; cents for withdrawal
const double Adult::OVERDRAFTPENALTY ; dollar
class Student : public Customer
public:
static const double SAVINGSINTEREST;
static const double CHECKCHARGE;
static const double OVERDRAFTPENALTY;
static const double CHECKINGINTEREST;
Studentstd::stringf name, std::string address, int age, std::string phone, int custNum
: Customername address, age, phone, custNum
;
const double Student::SAVINGSINTEREST ; annual rate
const double Student::CHECKINGINTEREST ; annual rate. Yes! this is interest rate for the checking account.
const double Student::CHECKCHARGE ; cents for withdrawal
const double Student::OVERDRAFTPENALTY ; dollar
class Account
public:
Customer customer;
float balance;
int accountnumber;
std::vector transaction;
void addinterest;
AccountCustomer c double balance, int num
: customerc balancebalance accountnumbernum
int getaccountnumber const
return accountnumber;
double getbalance const
return balance;
Member functions definitions
virtual void depositdouble amount, Date date;
virtual void withdrawdouble amount, Date date
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