Create an ATM class with class variables name, pin, and balance, a constructor with parameters to assign values to the three instance variables, methods to get the name, pin, and balance, and methods to handle validated deposits and withdrawals ( deposit and withdrawal amounts cannot be negative, and withdrawal amount must not be greater than the existing balance).
In the ATMTest class, read the names, 4 digit pin numbers, and account balances of five or more (max 10) customers into instances of the ATM class. Display the customers names, pins, and balances formatted.
Now that you have all your customers’ information start your ATM to accomplish the following within an infinite loop, a. Display a welcome screen with your bank’s information and prompt for and read the customer entered pin. b. Match the entered pin with one of the customers’ pins. If the entered pin number matches that of one of the customers, then: i. Welcome the customer by name and display the balance. ii. Display option to
DEPOSIT,
WITHDRAW or
EXIT. iii. If option 1 is selected, then use the instance deposit method to prompt for deposit amount, read, and add a valid deposit amount to the customer’s balance iv. If option 2 is selected, then use the instance withdrawal method to subtract a valid withdrawal amount from the customers balance v. If option 3 is selected, go to step a.
Should the entered pin number not match that of any of the existing customers, notify the iser that the entered pin is not valid and go to step a.
Selection of the EXIT option must display welcome/login screen (step a).
Should an incorrect option be entered, notify the user and display the original welcome/login screen (step a).
Our customer support team is here to answer your questions. Ask us anything!