Question: Code needed for C#: Prompt 1 - Instantiate a BankPrompt 2 - Create Bank AccountsPrompt 3 - Deposit MoneyPrompt 4 - Withdraw MoneyPrompt 5 -
Code needed for C#:
Prompt Instantiate a BankPrompt Create Bank AccountsPrompt Deposit MoneyPrompt Withdraw MoneyPrompt Check Account BalancePrompt Handle Insufficient FundsPrompt List All Accounts in a BankPrompt Transfer Funds Between AccountsPrompt Bank Capacity Check
Bank
Name: string
AccountList: BankAccount
NextOpenlndex: int Tracks the next available open index in the AccountList array. Note that this variable Should only ever be incremented after being initially set in this assignment.
All properties have standard getter and setter methods.
BankbankName: string, maxNumAccounts: int
Initializes name to be bankName, and makes accountList the size specified.
BankbankName: string, bankAccounts: BankAccount
Initializes name to be bankName, and intializes accountList and adds all of the accounts in bankAccounts to accountList. Make sure to update the NextOpenIndex variable to appropriately reflect that this bank does not have any open slots.
AddAccountaccount: BankAccount: bool
If there is room at the bank ie accountList is not full think of how we can use our instance variables to check for this and account is not already a part of the accountList, add account to accountList, increment nextOpenIndex, and return true.
Else, print the reason for not adding the account and return false.
TransferaccTransferFrom: BankAccount, accTransferTo: BankAccount, amount: double: bool If there are sufficient funds in accTransferFrom, then the amount specified is transferred from accTransferFrom to accTransferTo and true is returned. Else, print that the message "There are insufficient funds in account
As well, as using the the Bank Account class below
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
