ATM Program

Overview:

In this program, you'll create an ATM simulator. The program will use a data file that stores three pieces of information, an account number, a pin number, and an account balance. The user will run the program, which will ask the account number and pin. If the account number and pin match, they can do three things: balance inquiry, deposit, or withdraw.

Specifics:

Start by creating a data file in notepad. Type these three lines and save the file as atmdata (text file):

123456
1111
300

The lines represent the account number (123456), the PIN number (1111) and the account balance ($300.00).

After you've created the data file, begin writing your program. You'll need the following subroutines:

Load.Data: This subroutine opens the data file and retrieves the three pieces of data, loading the the data into local variables.

Login: This subroutine has the user enter an account number and PIN. It loops until either the user enters the correct account and PIN or until they've failed three times.

Menu: This subroutine allows the user to make three choices. 1 = Balance Inquiry, 2 = Deposit, 3 = Withdraw.

Menu.Action: This subroutine acts on their menu choice. It will either print the balance, allow them to add money, or allow them to remove money. When adding or removing money, the program should ask them how much and make the appropriate adjustment to the balance.

Save.Data: After the action has been preformed, the program opens the data file again and WRITEs the new values for account number, PIN, and balance.

Extensions:

  1. Allow them the option of changing their PIN.
  2. Validate, validate, validate...Make sure that this program doesn't allow them to do invalid things, like add a negative deposit, remove more money than they have...etc.