Question
You will be creating a custom class that for a bank account. It will track the users name, bank account and checking account. The user
You will be creating a custom class that for a bank account. It will track the users name, bank account and checking account. The user will make 3 deposits or withdrawals in either of the 2 accounts and the totals will be given.
1. First create a new custom class file called BankAccount.
2. Create your 3 member variables and the constructor function to build the object.
3. Create Getters and Setters for each of the 3 member variables
4. Code a custom method in the class file that will add the checking and banking account together and return the grand total.
5. In your Main Method:
a. Prompt the user for each of these variables and validate correctly. i. Full Name ii. Starting Checking Account Value iii. Starting Bank Account Value
b. Use these user prompted values to instantiate a new BankAccount object.
c. Once the object is created: i. Alert the user that it has been done and give them the starting values of each account. ii. Use the custom method and give the user the grand total of both of their accounts combined.
d. Next create a loop that will repeat for 3 times.
e. In the loop do the following for each iteration: i. Prompt the user if they would to withdrawal or deposit money.
1. You can have the user type in (1) for withdrawal or (2) for deposit. ii. Prompt the user for which account they would like to make the change to. iii. Using the getters and setters make the change, IF ALLOWED.
1. What this means is verify the user has enough funds if they are withdrawing money.
2. Example: do not let them take $1,000, if they only have $500. iv. At the end of each loop give the user their current total in each of their 2 accounts.
f. After the loop runs 3 times and changes have been made to the account balances: i. Give the user a final output with each account total. ii. Use the custom method and give the user the grand total of both of their accounts combined. User Input (Ask & Validate In Main Method, Use To Instantiate Object as the Member Variables): o Users Full Name o Starting Checking Account Value o Staring Bank Account Value Constructor Function: o Take in all member variables and create an object from them Custom Function o This function should take the checking member variable and add it to the banking account member variable to give the sum of both accounts.
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