ATM Document
ATM Document
7. SOURCE CODE
8. OUTPUT
9. BIBLIOGRAPHY
OBJECTIVE OF THE PROJECT:
The objective of this project is to create a system that allows
users to perform banking transactions such as cash
withdrawals, deposits, and balance inquiries. The project is
typically designed to simulate the functionality of an actual ATM
machine. The application of Python programming language and
SQL database management system allows for the creation of a
user-friendly interface and efficient data management.
2
HARDWARE REQUIREMENTS:
Processor: Intel Pentium 4 or later or compatible
Hard Disk: 410GB or more
RAM: 1GB or more
Printer: Any
Monitor: SVGA color monitor (touch screen or simple)
Pointing Device: Touch pad or keys
SOFTWARE REQUIREMENTS:
3
FUNCTION:
A function is a block of code, which only runs when it is called.
You can pass data, known as parameters, into a function. A
function can return data as a result.
cursor()
execute()
print()
int()
fetchall()
commit()
fetchone()
connect()
4
MODULE:
A Python module is a file containing Python definitions and
statements. A module can define functions, classes, and
variables.
Modules used in this project:
Mysql.connector: This method sets up a connection, establishing
a session with the MySQL server. If no arguments are given, it
uses the already configured or default values. A connection with
the MySQL server can be established using either
the mysql.connector.connect() method or
the mysql.connector.MySQLConnection()
5
SOURCE CODE
import mysql.connector
mydb=mysql.connector.connect(host='localhost',user='root',password='Tig
er')
mycursor=mydb.cursor()
conn=mysql.connector.connect(host='localhost',user='root',password='Tige
r',database=' ATM_MACHINE')
c1=conn.cursor()
print("=======================================================
=========================")
print("=======================================================
=========================")
if op==1:
c="y"
6
while c=="y":
m=int(input("Enter a 4 digit number as account number:"))
cb="select * from records where ACCONT_NO={}".format(m)
c1.execute(cb)
d=c1.fetchall()
data=c1.rowcount
if data==1:
print("=======================================================
=========================")
print("=======================================================
=========================")
if c=="y":
continue
else:
print(" Thank you.")
print(" PLEASE CLOSE THIS FILE BEFORE
EXITING")
print("Visit again")
print("=======================================================
=========================")
else:
name=input("Enter your name:")
passw=int(input("Enter your pass word:"))
ab="insert into records(ACCONT_NO,PASSWORD,NAME)
values({},{},'{}')".format(m,passw,name)
print("=======================================================
=========================")
c1.execute(ab)
7
conn.commit()
print("Account sucessfully created")
print("The minimum balance is 1000 ")
print("=======================================================
=========================")
print("=======================================================
=========================")
8
print("=======================================================
=========================")
print("=======================================================
=========================")
print("=======================================================
=========================")
if r==1:
amt=int(input("Enter the money to be deposited:"))
print("=======================================================
=========================")
print("=======================================================
=========================")
if t=="y":
continue
else:
print(" Thank you")
print(" PLEASE CLOSE THIS FILE BEFORE
EXITING")
if r==2:
amt=int(input("Enter the money to withdraw:"))
print("=======================================================
=========================")
print("=======================================================
=========================")
else:
sr="update records set balance=balance - {} where
ACCONT_NO={}".format(amt,acct)
ed="update records set WITHDRAWL ={} where
ACCONT_NO={}".format(amt,acct)
c1.execute(ed)
c1.execute(sr)
conn.commit()
print("Please collect the amount")
y=input("do you want to continue y/n -")
10
if y=="y":
continue
else:
print(" Thank you")
print(" PLEASE CLOSE THIS FILE BEFORE
EXITING")
if r == 3:
act = int(input("Enter the account number to be
transferred: "))
cb = "SELECT * FROM records WHERE
ACCONT_NO = {}".format(act)
c1.execute(cb)
c1.fetchall()
data = c1.rowcount
if data == 1:
print(act, "number exists")
m = int(input("Enter the money to be transferred:
"))
ah = "SELECT BALANCE FROM records WHERE
ACCONT_NO = {}".format(acct)
c1.execute(ah)
c = c1.fetchone()
if m > c[0]:
print("You have less than", m)
print("Please try again")
else:
av = "UPDATE records SET BALANCE =
BALANCE - {} WHERE ACCONT_NO = {}".format(m, acct)
cv = "UPDATE records SET BALANCE =
BALANCE + {} WHERE ACCONT_NO = {}".format(m, act)
w = "UPDATE records SET WITHDRAWL =
WITHDRAWL + {} WHERE ACCONT_NO = {}".format(m, acct)
t = "UPDATE records SET CR_AMT = CR_AMT
+ {} WHERE ACCONT_NO = {}".format(m, act)
c1.execute(av)
c1.execute(cv)
c1.execute(w)
c1.execute(t)
11
conn.commit()
print("Successfully transferred")
y = input("Do you want to continue? (y/n): ")
if y == "y":
continue
else:
print(" Thank you")
print(" PLEASE CLOSE THIS FILE
BEFORE EXITING")
if r==4:
ma="select balance from records where
ACCONT_no={}".format(acct)
c1.execute(ma)
k=c1.fetchone()
print("Balance in your account=",k)
print("=======================================================
=========================")
else:
print("Wrong password")
print("=======================================================
=========================")
else:
12
print("your Account does not exists")
if op==3:
print("Exiting")
print("Please close this file before exiting.")
c1.close()
13
OUTPUT
14
15
16
BIBLIOGRAPHY:
1. Book – Python by Sumita Arora
2. www.python.org
3. https://www.geeksforgeeks.org
17