Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java: Write an application that simulates a simple Automatic Teller Machine. Your application must incorporate multiple classes, arrays, and file input. Your ATM application must

Java: Write an application that simulates a simple Automatic Teller Machine. Your application must incorporate multiple classes, arrays, and file input. Your ATM application must first read existing client information from an input text file after which you will startup the ATM which will allow authenticated clients to view their balance, make deposits, or withdraw cash, while maintaining their updated balance. This is a perpetual ATM and cannot be shutdown.

The CLIENT class must consist of:

1. Four private instance variables: pin, first and last name, and balance

2. Constructor with values to initialize the values of the four instance variables

3. Methods to set and retrieve the pin, full name, and balance

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 must do the following

1. Use a method to read the pin, first and last name, and balance of 10 customers from the given input text file (clients.txt) into an array of objects of the CLIENT class. Output the same from main to demonstrate the successful execution of this method and the start of your perpetual Automatic Teller Machine

2. Display a welcome screen, then prompt and read the user entered pin number.

3. Use a method to match the entered pin with one of the customers pins. Return the index of the matching customer or -1 if there is no match.

4. If the entered information matches that of one of the customers in the array: a. Welcome the customer by full name. b. Display the following choices: i. Withdrawal ii. Deposit iii. Current balance iv. Exit

5. Should the entered information not match that of any of your customers, inform the user that the entered pin does not match any existing customers and to try again. Follow this by displaying of the original welcome screen (step 2).

6. If the Withdrawal option is selected, prompt and read the withdrawal amount, ensure the amount is valid, update and display the latest balance, and then prompt the user to enter M or m to view menu in step 4b or X or x to exit.

7. If the Deposit option is selected, prompt and read the deposit amount, ensure the deposit amount is valid, update and display the latest balance, and then prompt the user to enter M or m to view menu in step 4b or X or x to exit.

8. The Current balance option must display the current balance followed by a prompt to enter M or m to view menu in step 4b or X or x to exit. 9. Upon selecting Exit, the original login screen (step2) must display.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions