Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using Java, write an application with multiple classes similar to class Account and driver class AccountTest. You will call your classes as ATM and ATMTest.
Using Java, write an application with multiple classes similar to class Account and driver class AccountTest. You will call your classes as ATM and ATMTest. Your ATM application allows you to first create clients and then startup the ATM to allow your clients to be authenticated so they can view their balance, make deposits, or withdraw cash, while maintaining their updated balance. This is a perpetual ATM and cannot be shutdown.
The ATM class, similar to Account class must consist of:
1. Three private instance variables name, pin, and balance
2. Constructor with parameters to initialize the values of the three instance variables
3. Methods to set and retrieve the values of the three instance variable
4. Method that deposits or adds a valid amount to the balance
5. Method that withdraws or subtracts a valid amount from the balance
The ATMTest class, similar to the AccountTest class must do the following
1. Use a method to prompt and read the names, pins, and balances of two customers into two instances of the ATM class. Output the same from main to demonstrate the successful execution of this method and start your perpetual Automatic Teller Machine
2. Display a welcome screen followed by a prompt for the user to enter a valid pin number.
3. If the entered information matches that of one of the two customers:
a. Welcome the customer by name.
b. Display the following choices:
i. Withdrawal
ii. Deposit
iii. Current balance
iv. Exit
2. Should the entered information not match that of any of your customers, inform the user that the entered information does not match existing customers and to try again.? Follow this by displaying of the original welcome screen (step 2).
3. If the Withdrawal option is selected, prompt the customer for the withdrawal amount, and when entered, echo the amount, display the latest balance, then prompt the user to enter M or m to view menu in step 3b or X or x to exit.
4. If the Deposit option is selected, prompt the customer for the deposit amount, and when entered, echo the deposit amount, display the latest balance, then prompt the user to enter M or m to view menu in step 3b or X or x to exit.
5. The Current balance option must display the current balance followed by a prompt to
enter M or m to view menu in step 3b or X or x to exit.
6. Upon selecting Exit, the original login screen (step2) must display
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