0% found this document useful (0 votes)
8 views

Atm Usecases

The document discusses an ATM simulation system built in Python. It defines the problem, outlines the algorithm and modules used, and provides the implementation code. The code simulates login, allowing users to check balances, withdraw and deposit money, change PINs, and logout of the ATM simulation.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Atm Usecases

The document discusses an ATM simulation system built in Python. It defines the problem, outlines the algorithm and modules used, and provides the implementation code. The code simulates login, allowing users to check balances, withdraw and deposit money, change PINs, and logout of the ATM simulation.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

TABLE OF CONTENTS

Chapter Contents Page


No.
1 INTRODUCTION 3

2 PROBLEM DEFINITION 3

3 Algorithm / Step 4

4 IMPLEMENTATION 5-12

5 RESULTS 13

6 CONCLUSIONS AND FUTURE SCOPE 14

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.

3. Algorithm / Step (Explain the different modules/functions used )

1) We have run the program in python IDLE


2) Our project is based on ATM SIMULATION
3) The fuctions of atm simulation are:
enter the correct username and passsword to login
Deposit:this function helps us to
deposit the money
withdrawal:Through this function we can
take our money from the
machine
Statement:we get the mini statement of
our account
Pin Change:through this function we can change the pin of our
credit card.
Quit:this function helps us to terminate the process

4
4. IMPLEMENTATION (Code)

import getpass
import string
import os

users = ['user1', 'user2', 'user3']


pins = ['1111', '2222', '3333']
amounts = [1000, 2000, 3000]
count = 0
# while loop checks existance of the enterd username
while True:
user = input('\nENTER USER NAME: ')
user = user.lower()
if user in users:
if user == users[0]:
n=0
elif user == users[1]:
n=1
else:
n=2
break
else:
print('----------------')
print('****************')
print('INVALID USERNAME')
print('****************')
print('----------------')

# 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

# in case of a valid pin- continuing, or exiting


if count == 3:
print('-----------------------------------')
print('***********************************')
print('3 UNSUCCESFUL PIN ATTEMPTS, EXITING')
6
print('!!!!!YOUR CARD HAS BEEN LOCKED!!!!!')
print('***********************************')
print('-----------------------------------')
exit()

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('---------------------------------------------')

elif response == 'w':


print('---------------------------------------------')
print('*********************************************')
cash_out = int(input('ENTER AMOUNT YOU WOULD LIKE TO
WITHDRAW: '))
print('*********************************************')
print('---------------------------------------------')
7
if cash_out%10 != 0:
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('-----------------------------------')

elif response == 'd':


print()
print('---------------------------------------------')
print('*********************************************')
cash_in = int(input('ENTER AMOUNT YOU WANT TO DEPOSIT: '))
print('*********************************************')
print('---------------------------------------------')
print()
if cash_in%10 != 0:
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

We have successfully completed our mini project ‘ATM Simulation’ in python.


We have performed operations like 1.)withdrawal 2.)Cash Deposit 3.)Pin change(completed
invisible pin for extra security only unto 3 attempts after that the card is automatically blocked.)
Time taken to complete the project is roughly two weeks.

12

You might also like