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

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 7RQ
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage