Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem In this question, you will implement a program to simulate a series of basic bank transactions. When the program is run, the user
Problem In this question, you will implement a program to simulate a series of basic bank transactions. When the program is run, the user should asked to input the initial bank balance. Afterwards, the user will be prompted with a text-based menu with three options: 1. Deposit 2. Withdraw 3. Quit If the user enters the number 3, the program should terminate. If the user enters the number 1 or 2, they should be prompted with a request to enter their personal identification number (PIN). If the user enters the correct number (for simplicity, assume the user's pin is "1234"), they should be prompted to enter the amount to Deposit or Withdraw, depending on the command entered. Based on the amount entered, up- date the user's balance accordingly and print a message indicating the new balance in the user's account. Continue presenting the user with the menu until the user quits the program (the user should be able to continue to make withdrawals and deposits within the same session). See the following sample output from the program: Please enter starting balance: 500 The current balance is: 500.0 What would you like to do? 1. Deposit Money 2. Withdraw Money 3. Exit 1 Please enter PIN: 5467 Incorrect PIN. The current balance is: 500.0 What would you like to do? 1. Deposit Money 2. Withdraw Money 3. Exit 1 Please enter PIN: 1234 UNIVERSITY OF SASKATCHEWAN Department of Computer Science 1 da 110 FE T Please enter amount to deposit: 250 The current balance is: 750.0 What would you like to do? 1. Deposit Money 2. Withdraw Money 3. Exit 2 Please enter PIN: 1234 Please enter amount to withdraw: 1000 Insufficient funds The current balance is: 750.0 What would you like to do? 1. Deposit Money 2. Withdraw Money 3. Exit 2 Please enter PIN: 1234 Please enter amount to withdraw: 749.50 The current balance is: 0.5 What would you like to do? 1. Deposit Money 2. Withdraw Money 3. Exit 3 Page 3 Program terminated. Final balance is: 0.5 Process finished with exit code 0 CMPT 270 Fall 2023 Developing Object Oriented Systems Hints: . You will need to use a loop to implement the main menu mechanism . You will need to use the Scanner class to read input from the console (since we have not yet covered exceptions and error handling in class, you can just assume that only valid input will be entered)
Step by Step Solution
★★★★★
3.43 Rating (153 Votes )
There are 3 Steps involved in it
Step: 1
Below is a simple java program that fulfills the requirements outlined in the problem import javauti...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