Archi_with_adjusted_border
Archi_with_adjusted_border
1
ACKNOWLEDGMENT
CERTIFICATE
2
CERTIFICATE
INTERNAL EXAMINER
3
PROJECT CONTENTS
S.NO DESCRIPTION
1.
2.
3.
4.
5.
6.
4
SOFTWARE AND HARDWARE REQUIREMENTS
SOFTWARE REQUIREMENTS:
I. Windows OS
II. Python
III. Mysql Community
5
ATM MACHINE
FRONT END : PYTHON
BACK END : MYSQL
DATABASE REQUIREMENT
import mysql.connector
conn=mysql.connector.connect(host='localhost',user='root',password='root')
if conn.is_connected():
print("sucessfully connected")
c1=conn.cursor()
mn="CREATE DATABASE IF NOT EXISTS ATM_MACHINE"
c1.execute(mn)
print("Successfully created")
sql="CREATE TABLE IF NOT EXISTS RECORDS( ACCONT_NO INT(4)
primary key,\
6
PASSWORD INT(3),NAME VARCHAR(20),CR_AMT INT default 0,\
WITHDRAWAL INT default 0,BALANCE INT default 0 )"
conn=mysql.connector.connect(host='localhost',user='root',password='root',database='
ATM_MACHINE')
c1=conn.cursor()
c1.execute(sql)
print("="*60)
print("WELCOME TO DOON ATM")
print("="*60)
print("1.To create account")
print("2.To login")
print("3.Exit")
print("="*60)
op=int(input("Enter your choice :"))
print("="*60)
if op==1:
c="y"
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("="*60)
print("This account number already exists:")
c=input("Do you want to continue y/n -")
print("="*60)
if c=="y":
7
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 password (in digit number):"))
ab="insert into records(ACCONT_NO,PASSWORD,NAME)
values({},{},'{}')".format(m,passw,name)
print("========================================================
========================")
c1.execute(ab)
conn.commit()
print("Account sucessfully created")
print("The minimum balance is 1000 ")
print("========================================================
========================")
print("========================================================
========================")
8
sr="update records set CR_AMT={} where
ACCONT_NO={}".format(s,m)
c1.execute(sr)
conn.commit()
ef="update records set balance=cr_amt-withdrawal where
ACCONT_NO={}".format(m)
c1.execute(ef)
conn.commit()
print("sucessfully deposited")
print("========================================================
========================")
9
c1.execute(e)
a=c1.fetchone()
d=list(a)
if pas==d[0]:
print("correct")
print("1.Depositing money")
print("2.withdrawing money")
print("3.Transfering money")
print("4.Checking balance")
print("5.Changing Account number ")
print("========================================================
========================")
print("========================================================
========================")
if r==1:
amt=int(input("Enter the money to be deposited:"))
print("========================================================
========================")
10
c1.execute(ef)
conn.commit()
print("sucessfully deposited")
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("========================================================
========================")
11
else:
sr="update records set balance=balance - {} where
ACCONT_NO={}".format(amt,acct)
ed="update records set WITHDRAWAL ={} where
ACCONT_NO={}".format(amt,acct)
c1.execute(ed)
c1.execute(sr)
conn.commit()
print("Sucessfully updated")
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==3:
act=int(input("Enter the account number to be transferred :"))
print("========================================================
========================")
12
print(act ,"number exists")
m=int(input("Enter the money to be transferred :"))
print("========================================================
========================")
print("========================================================
========================")
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 withdrawal=withdrawal{} 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)
13
conn.commit()
print("Sucessfully 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("========================================================
========================")
14
c1.fetchall()
data=c1.rowcount
if data==1:
print("This number already exists")
print("Try again")
else:
print("Wrong password")
print("========================================================
========================")
15
else:
print("your Account does not exists")
if op==3:
print("Exiting")
print("Please close this file before exiting.")
c1.close()
16
17
BIBLIOGRAPHY
S.NO Book-Name
Computer Science with Python ( Reeta Sahoo)
1.
18