ey want to create; either cheque or saving. To create an account, the user needs a full name and pin code. The pin code will be used before any operation is allowed. Bank_Account should be the base class and have two derived classes: Cheque_Account and Savings_account. Bank_Account should have the following methods as public: createAccount();checkBalance();withdra

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Question 1
Create a program that allows users to create a bank account. Users are to choose which
accounts they want to create; either cheque or saving. To create an account, the user needs a
full name and pin code. The pin code will be used before any operation is allowed.
Bank_Account should be the base class and have two derived classes: Cheque_Account and Savings_account.
Bank_Account should have the following methods as public:
createAccount();checkBalance();withdraw();deposit();
getAccountStatement();getPin();setAccountType ();getAccountType();
Both withdraw and deposit should be virtual functions. All the account details – name, balance,
and PIN CODE – should be stored in a struct.
The program should have a menu that displays all the options for the user.


ChequeAccount should have the following methods: withdraw(), getStatement(), writeCheques()
viewAllCheques(). The cheque should be stored in a struct. A maximum of 10 cheques should be
allowed. A cheque should have a name and amount.
 withdraw() should withdraw an amount entered by the user and tax the account 3% of the
withdrawal. This function should override the withdraw function from the base class.
 writeCheques() should have a person’s name and the amount of the cheque. No cheque should be allowed to be more than the balance.
 viewAllCheques() should display all the cheques processed, the name of the beneficiary, the
amount and the cheque number (cheque 1, cheque 2).
 SavingsAccount should have the following methods: deposit(), getSavings() and a private
member addsavings(). A struct should be used to store all of the savings amounts.
 deposit() – 3% of the deposited amount should be added to the savings account every time a user makes a deposit.
 getSavings() displays the balance of the savings account.
 addSavings() is a private member that calculates the savings in the account after every deposit.


Use the base class:
class Bank_Account
{
public:
Bank_Account();
void createAccount(string,int);
float checkBalance();
virtual void withdraw(float);
virtual void deposit(float);
void getAccountStatement();
int getPin();
void setAccountType (string setAccount);
string getAccountType();
~Bank_Account(void);
private:
accountDetails theAccdetails;
string accountType;
};

Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
JQuery and Javascript
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education