Atm Usecases
Atm Usecases
2 PROBLEM DEFINITION 3
3 Algorithm / Step 4
4 IMPLEMENTATION 5-12
5 RESULTS 13
7 REFERENCES 14
2
INTRODUCTION
The aim of the ATM Simulation System project is to build a Python based ATM (Automated
Teller Machine) Simulation System. The introduction of ATM’s by various banks have
brought about freedom from the interminable queues in front of withdrawa l counters at
banks. This ATM Simulation System requires the constant updating of records between the
bank servers and a spread out network of ATM’s.
Security is the foundation of a good ATM system. This system will provide for secure
authenticated connections between users and the bank servers. The whole process will be
automated right from PIN (Personal Identification Number) validation to transaction
completion. ATM Simulation System will enable two important features of an ATM,
reduction of human error in the banking system and the possibility of 24 hour personal
banking. The card details and PIN database will be a secure module that will not be open to
routine maintenance, the only possibility of access to this database will be through queries
raised from an ATM in the presence of a valid bank ATM card.
3
2. PROBLEM DEFINITION
THE SOURCE CODE DECLARED ABOVE FOR THE PROGRAM OF ATM
SIMULATION HAS BEEN TESTED AND IT HAS BEEN FOUND THAT THE ABOVE
SOURCE CODE IS OKAY AND CORRECT. THE PROGRAM INVOLVES MANY
TYPE OF CONVERSIONS. THESE CONVERSIONS HAS TO DONE CAREFULLY.
MAINLY THERE ARE TWO TYPES OF TESTING:
1-SYSTEM TESTING AND
2-INTEGRATION TESTING
SYSTEM TESTING INVOLVES WHOLE TESTING OF PROGRAM AT ONCE AND
INTEGRATION TESTING
INVOLVES THE BREAKING OF PROGRAM INTO MODULES & THEN TEST.
4
4. IMPLEMENTATION (Code)
import getpass
import string
import os
# comparing pin
while count < 3:
print('------------------')
print('******************')
pin = str(getpass.getpass('PLEASE ENTER PIN: '))
print('******************')
print('------------------')
if pin.isdigit():
if user == 'user1':
if pin == pins[0]:
break
else:
count += 1
5
print('-----------')
print('***********')
print('INVALID PIN')
print('***********')
print('-----------')
print()
if user == 'user2':
if pin == pins[1]:
break
else:
count += 1
print('-----------')
print('***********')
print('INVALID PIN')
print('***********')
print('-----------')
print()
if user == 'user3':
if pin == pins[2]:
break
else:
count += 1
print('-----------')
print('***********')
print('INVALID PIN')
print('***********')
print('-----------')
print()
else:
print('------------------------')
print('************************')
print('PIN CONSISTS OF 4 DIGITS')
print('************************')
print('------------------------')
count += 1
print('-------------------------')
print('*************************')
print('LOGIN SUCCESFUL, CONTINUE')
print('*************************')
print('-------------------------')
print()
print('--------------------------')
print('**************************')
print(str.capitalize(users[n]), 'welcome to ATM')
print('**************************')
print('----------ATM SYSTEM-----------')
# Main menu
while True:
#os.system('clear')
print('-------------------------------')
print('*******************************')
response = input('SELECT FROM FOLLOWING OPTIONS:
\nStatement__(S) \nWithdraw___(W) \nDeposit__(D) \nChange PIN_(P)
\nQuit_______(Q) \n: ').lower()
print('*******************************')
print('-------------------------------')
valid_responses = ['s', 'w', 'd', 'p', 'q']
response = response.lower()
if response == 's':
print('---------------------------------------------')
print('*********************************************')
print(str.capitalize(users[n]), 'YOU HAVE ', amounts[n],'RUPEES ON
YOUR ACCOUNT.')
print('*********************************************')
print('---------------------------------------------')
print('******************************************************')
print('AMOUNT YOU WANT TO WITHDRAW MUST TO
MATCH 10 RUPEE NOTES')
print('******************************************************')
print('------------------------------------------------------')
elif cash_out > amounts[n]:
print('-----------------------------')
print('*****************************')
print('YOU HAVE INSUFFICIENT BALANCE')
print('*****************************')
print('-----------------------------')
else:
amounts[n] = amounts[n] - cash_out
print('-----------------------------------')
print('***********************************')
print('YOUR NEW BALANCE IS: ', amounts[n], 'RUPEES')
print('***********************************')
print('-----------------------------------')
print('****************************************************')
print('AMOUNT YOU WANT TO LODGE MUST TO MATCH
10 RUPEES NOTES')
print('****************************************************')
print('----------------------------------------------------')
else:
amounts[n] = amounts[n] + cash_in
8
print('----------------------------------------')
print('****************************************')
print('YOUR NEW BALANCE IS: ', amounts[n], 'RUPEES')
print('****************************************')
print('----------------------------------------')
elif response == 'p':
print('-----------------------------')
print('*****************************')
new_pin = str(getpass.getpass('ENTER A NEW PIN: '))
print('*****************************')
print('-----------------------------')
if new_pin.isdigit() and new_pin != pins[n] and len(new_pin) == 4:
print('------------------')
print('******************')
new_ppin = str(getpass.getpass('CONFIRM NEW PIN: '))
print('*******************')
print('-------------------')
if new_ppin != new_pin:
print('------------')
print('************')
print('PIN MISMATCH')
print('************')
print('------------')
else:
pins[n] = new_pin
print('NEW PIN SAVED')
else:
print('-------------------------------------')
print('*************************************')
print(' NEW PIN MUST CONSIST OF 4 DIGITS \nAND
MUST BE DIFFERENT TO PREVIOUS PIN')
print('*************************************')
print('-------------------------------------')
elif response == 'q':
exit()
else:
print('------------------')
print('******************')
print('RESPONSE NOT VALID')
print('******************')
print('------------------')
5. RESULTS (SNAPSHOTS)
9
10
11
6. CONCLUSION AND FUTURE SCOPE
12