Question
--------------For this project, you will create a simple banking program that will allow a user to setup a bank account with initial nonzero amounts for
--------------For this project, you will create a simple banking program that will allow a user to setup a bank account with initial nonzero amounts for checking and savings, deposit money into the account, withdraw money from the account, and transfer money between checking and savings.
------Algorithms and Output Specification Implementation
----Details for the Bank Account
This program should be implemented using only one class named "Assignment3". The program must contain a main method only.
The bank provides three types of accounts:
1. Basic Account: where the total balance of saving and checking is between 0 to 1000 - Interest rate is 2.5% (0.025)
2. Premium Account: where the total balance of saving and checking is at least 1000 and up to (and including) 5000 - Interest rate is 3.5%
3. Platinum Account: where the balance is over 5000 - Interest rate is 4.5%
-----Creating the bank account
When the program begins, the following text is displayed:
Welcome to CSE110 Bank
What is your name? Grace Hopper
Notice that the cursor is on the same line as the prompt ("What is your name? "). The program must save the name in a variable to use later
The program will then ask for an initial deposit into savings. This value must be saved for later use. You have to validate the input to make sure the user will enter a positive amount.
For example: Initial deposit into Savings: 1000
The program will then ask for an initial deposit into checking. This value must be saved for later use.
For example: Initial deposit into Checking: 500
-----Main Menu Display
After the account is created, the user can deposit money, withdraw money, or transfer money until they choose to quit
The menu to be displayed: (Use a switch statement to print the menu)
Bank Options:
1. Deposit Money
2. Withdraw Money
3. Transfer Money
4. Quit Your choice: The user will enter a number that is between 1 and 4. After the user enters a valid action the account balance will be displayed,
For example: Grace Hoppers Account balance: $1500.00 (S: $1000.00, C: $500.00)
The current type of account should be displayed, and the amount should be displayed in currency format (the balances can of course be different from those displayed)
-----1. Deposit Money
The first option is to deposit money. When the user selects this option, the following menu is displayed:
Deposit Money Options:
1. Deposit to Checking
2. Deposit to Savings
3. Cancel
Your choice:
1 Amount to deposit to Checking: 150
After the amount is successfully entered, a final message is displayed (replace "Checking" with "Savings" when appropriate):
You deposited $150.00 to Checking.
2. Withdraw Money
The second option is to withdraw money. When the user selects this option, the following menu is displayed:
Withdraw Money Options:
1. Withdraw from Checking
2. Withdraw from Savings
3. Cancel
Your choice:1
Once a valid option has been chosen, the action is taken. If the user chooses option 3 (Cancel) "Cancel Withdraw." is displayed and the program will terminate. If they choose 1 or 2 the prompt is displayed asking for the amount to be withdrawn. It can be either for checking: Amount to withdraw from Checking:
or for savings:
Amount to withdraw from Savings:
You must check that the user does not withdraw more money than they have in the account.
For example, (replace "Checking" with "Savings" if appropriate):
Withdraw Money Options:
1. Withdraw from Checking
2. Withdraw from Savings
3. Cancel
Your choice: 1
Amount to withdraw from Checking: 3000
Invalid choice (you don't have that much in your Checking).
After the amount is successfully entered, a final message is displayed as seen above (replace "Checking" with "Savings" when appropriate). If the user enters option 3 the program terminates.
3. Transfer Money
The third option is to transfer money. When the user selects this option, the following menu is displayed:
Transfer Money Options:
1. Transfer from Checking to Savings
2. Transfer from Savings to Checking
3. Cancel
Your choice: 1
If the user chooses option 3 (Cancel) "Cancel Transfer." is displayed (see the sample execution for an example). If they choose 1 or 2 the prompt is displayed asking for the amount to be withdrawn. It can be either for checking:
Amount to transfer from Checking to Savings: or for savings: Amount to transfer from Savings to Checking:
The error checking for the amount entered is the same as that for withdrawals. The program must check for a positive number and for an amount less than or equal to the amount currently in their account.
Two examples below:
Example 1
Transfer Money Options:
1Transfer from Checking to Savings
2. Transfer from Savings to Checking
3. Cancel
Your choice: 1
Amount to transfer from Checking to Savings: 250
You transferred $250.00 from Checking to Savings.
Example 2
Transfer Money Options:
1. Transfer from Checking to Savings
2. Transfer from Savings to Checking
3. Cancel
Your choice: 2
Amount to transfer from Savings to Checking: 10000 Invalid choice (you don't have that much in your Savings). After the displayed message , a final message is displayed (see the transaction finished message below).
Transaction Finished Message
After every transaction is completed (other than quitting) a message is displayed. This is displayed even when the user cancels the selected action (option 3 "Cancel" on the menu):
After this transaction your balance is: $1200.00 (S: $1000.00, C: $200.00). This message is the same no matter which type of transaction occurred
Interest will be added before terminating the program.
Displaying Amount: All amounts should be displayed with currency format
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