Write a program that simulates as Automatic Teller Machine (ATM). Since you probably don't have access to a card reader, have the initial screen ask for user id and a PIN. The user id will be used to look up the info for the user's accounts (including the PIN to see if it matches what the user types). Each user will have access to a checking account and a savings account. The user should able to check balances, withdraw cash, and transfer money between accounts. Design your interface to be similar to what you see on your local ATM. The user account information should be stored in a file when the program terminates. This file is read in again when the program restarts.
Step 11 of 7
For this program, I made two classes: , which handles all of the data processing, and , which holds the information for a single customer. To run this program you'll need to already have a text document containing customer accounts made as I don't provide a way to add a new customer (ATMS usually can't create new accounts with the bank). The formatting for the file is specified by lines containing the following information:
tab tab tab .
The ATM uses a menu-based interface that I tried to mimic the actual interfaces I've seen at ATMs.
Recommended textbook solutions
Write a program that simulates an arbitrary finite-state machine. The program should initially receive as input the next-state function, the output function, and the initial state. The program should then accept strings, simulate the action of the finite-state machine, and output the string produced by the finite-state machine.
Construct a finite-state machine for entering a security code into an automatic teller machine (ATM) that implements these rules: A user enters a string of four digits, one digit at a time. If the user enters the correct four digits of the password, the ATM displays a welcome screen. When the user enters an incorrect string of four digits, the ATM displays a screen that informs the user that an incorrect password was entered. If a user enters the incorrect password three times, the account is locked.