Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Written in a C++ version of the program. This banking system is to be created fo

ID: 3792321 • Letter: W

Question

Written in a C++ version of the program.

This banking system is to be created for this assignment. The program will consist of five(5) classes: MustangBanking (which will contain the main method), Account, CheckingAccount, SavingsAccount and Balance.

Both the CheckingAccount and SavingsAccount classes will inherit from class Account, and they will both have a data member of type Balance.

Within method main, which is within class MustangBanking, create an ArrayList of type Account. You may call this ArrayList accounts. Within a loop, display the messages “Welcome to your Mustang Bank!” and “Please choose from the following options:”. These options will be:

1 – Create a new Checking Account

2 – Create a new Savings Account

3 – Delete an existing account

4 – View a specific account

5 – View all accounts

6 – Write a check through a specific Checking Account

7 – Withdraw funds from a specific account

8 – Deposit funds into an account

9 – Exit Program Please enter your option below:

For option 1, call the method xCreateChecking, sending accounts. Upon returning, print out a statement that the Checking Account has been created.

For option 2, call the method xCreteSavings, sending accounts. Upon returning, print out a statement that the Savings Account has been created.

For option 3, call the method xDeleteAccount, sending accounts.

For option 4, call the method xViewSpecific, sending accounts.

For option 5, call the method xViewAll, sending accounts.

For option 6, call the method xWriteCheck, sending accounts.

For option 7, call the method xWithdraw, sending accounts.

For option 8, call the method xDeposit, sending accounts.

Option 9 should have the loop end and the program exit.

Classes:

The Account class will consist of:

-iId (integer)

-dInterestRate (double)

-bBalance (Balance) – Balance is a separate class

With methods: Constructor Account, which takes in the Id, Interest Rate and Balance amounts.

-getId

-setId

-getInterestRate

-setInterestRate

-deposit - which takes in an amount and adds that to the current balance withdraw – takes in an amount and subtracts it from the current balance NOTE: If funds do not exist for the withdraw, a message must be displayed that funds are not available.

-displayAccount – Displays a message showing the account Id, Balance and Interest Rate

The CheckingAccount class extends, or inherits from class Account. In addition, It has:

-Constructor CheckingAccount that takes in the ID, Balance and Interest Rate (recall, it must then call the super class with the command super() sending it the amounts as well)

It also has the methods:

-xWriteCheck – which accepts the account ID It will first loop through the accounts to determin if the given account exists If so, will prompt the user for the check amount and will withdraw the check amount from the account If the account DOES NOT exist, a message must be displayed indicating the given ID does not exist.

The SavingsAccount class extends the Account class as well. In addition, it has:

-Constructor SavingsAccount – Takes in the ID, Balance and Interest Rate (It too must then call the super class)

-Withdraw – which takes in an amount to withdraw If funds are available, the received amount is subtracted from the Balance Otherwise, a message is displayed indicating funds are not available.

The Balance class will consist of:

-dBalance (double)

with methods:

-Constructor Balance – Have a default constructor which sets the dBalance to 0.0 And a second constructor Balance which takes in an amount that Balance is set to.

-getBalance

-setBalance

PLEASE NOTE: During some of the method processing, you will want to be sure the account you are checking is either a savings or checking account. This can be done with the ‘instanceof’ operator. For example: If (accounts.get(i) instanceof SavingsAccount) { //-- this is a savings account } In addition, please draw/write-out a UML diagram for this program. NOTE: This specified requirements are written in accommodation of JAVA. If you prefer C++, please modify accordingly (e.g. use C++ array, no need for MustangBanking class).

Explanation / Answer

#include <iostream>

using namespace std;
class Account{
public int iId;
public double dInterestRate;
Balance bBalance;
char c,s;
Account(int Id,double Interest_Rate,Balance Balance_amount){
this.iId=Id;
this.dInterestRate=Interest_Rate;
this.Balance=Balance_amount;
}
Account(int Id,double Interest_Rate,Balance Balance_amount){
this.iId=Id;
this.dInterestRate=Interest_Rate;
this.Balance=Balance_amount;
}
public int getId(){
return iId;
  
}
public void setId(int iId){
this.iId=iId;
}
public double getInterestRate(){
return InterestRate;
}
public void setInterestRate(double InterestRate){
this.InterestRate=InterestRate;
}
public int deposit(int iId,double amount){
  
}
public int withdraw(double amount){}
public void displayAccount(int iId){}
public void delete(int iId){
int index=search(iId,ac[]);
  
  
}
public void all_accounts(Account ac[]){
for(int i=0;i<=ac.size();;i++){
cout<<"ac[i]";
}
  
}
  
}
class CheckingAccount extends Account{
CheckingAccount(int ID,Balance balace,double Interest_Rate ){}
public int xWriteCheck(int Id){}
}
class SavingsAccount extends Account{
SavingsAccount(int ID ,Balance balace,double Interest_Rate){}
public double Withdraw(int ID,Double Ammount){}
}
class Balance{
double dBalance;
Balance(double dBalance){
this.dBalance=0.0;
}
Balance(double dbalance){
this.dBalance=dbalance;
}
public double getBalance(int Id){}
public void setBalance(int id,double dBalance){}
}
class MustangBanking extends Account{
int main()
{
Account ac[20];
int n;
cout<<"Create a new Checking Account enter 1";
cout<<"Create a new Savings Account enter 2";
cout<<"Delete an existing account enter 3";
cout<<"View a specific account enter 4";
cout<<"View all accounts enter 5";
cout<<"Write a check through a specific Checking Account enter 6";
cout<<"Withdraw funds from a specific account enter 7";
cout<<"Deposit funds into an account enter 8";
cout<<"Exit Program Please enter your option below: enter 9";
cin>>n;
switch(n){
case 1:
Account a=Account("c",4,2.4,200000);
ac[0]=a;
  
break;
case 2:
Account a1=Account("s",9,2.48,20000);
ac[1]=a1;
break;
  
case 3:
ac.delete(9);
break;
case 4:
ac.displayAccount(4);
break;
case 5:
ac.all_Account();
  
break;
case 6:
break;
case 7:

ac.withdraw(200.00);
break;
case 8:
ac.deposit(4,234.56);
break;
case 9:
cout<<"exit";
default;
  
}

return 0;
}
}