0% found this document useful (0 votes)
32 views18 pages

XII ATM Project

Uploaded by

khshri3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views18 pages

XII ATM Project

Uploaded by

khshri3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Project

On
ATM MACHINE

1|Page
TABLE STRUCTURE

.....................................................................................................................................

2|Page
Source code
.....................................................................................................................................

tablecreation.py

import mysql.connector as sql


conn=sql.connect(host='localhost', user='root', password='tiger',
database='ATM_MACHINE')
if conn.is_connected():
print("sucessfully connected")
c1=conn.cursor()
mn="CREATE TABLE RECORD( ACCONT_NO INT(4) primary key, PASSWORD
INT(3), NAME VARCHAR(20), CR_AMT INT default(0), WITHDRAWL INT
default(0), BALANCE INT default(0))"
c1.execute(mn)

3|Page
main.py

import mysql.connector as sql


conn=sql.connect(host='localhost',user='root',password='tiger',database='ATM_MACHI
NE')
c1=conn.cursor()
print("==========================================================
======================")

print(" WELCOME TO CA TEAM ATM ")

print("==========================================================
======================")

print("1.To create account")


print("2.To login")
print("3.Exit")
print("==========================================================
======================")

op=int(input("Enter your choice :"))


print("==========================================================
======================")

if op==1:
c="y"
while c=="y":
m=int(input("Enter a 4 digit number as account number:"))
cb="select * from record where ACCONT_NO={}".format(m)
c1.execute(cb)
d=c1.fetchall()
data=c1.rowcount
if data==1:

4|Page
print("==========================================================
======================")

print("This account number already exists:")


c=input("Do you want to continue y/n -")

print("==========================================================
======================")

if c=="y":
continue
else:
print(" Thank you.")
print("Visit again")

print("==========================================================
======================")

else:
name=input("Enter your name:")
passw=int(input("Enter your pass word:"))
ab="insert into record(ACCONT_NO,PASSWORD,NAME)
values({},{},'{}')".format(m,passw,name)

print("==========================================================
======================")

c1.execute(ab)
conn.commit()
print("Account successfully created")
print("The minimum balance is 1000 ")

5|Page
print("==========================================================
======================")

s=int(input("Enter the money to be deposited :"))

print("==========================================================
======================")

sr="update record set CR_AMT={} where ACCONT_NO={}".format(s,m)


c1.execute(sr)
conn.commit()
ef="update record set balance=cr_amt-withdrawl where
ACCONT_NO={}".format(m)
c1.execute(ef)
conn.commit()
print("successfully deposited")

print(" Thank you")

print("Visit again")
break
if op==2:
y="y"
while y=="y":

acct=int(input("Enter your account number:"))


cb="select * from record where ACCONT_NO={}".format(acct)
c1.execute(cb)
c1.fetchall()
data=c1.rowcount
if data==1:
pas=int(input("Enter your password :"))

6|Page
print("==========================================================
======================")

e="select password from record where ACCONT_NO={}".format(acct)


c1.execute(e)
a=c1.fetchone()
d=list(a)
if pas==d[0]:
print("correct")
print("1.Depositng money")
print("2.withdrawing money")
print("3.Transfering money")
print("4.Checking balance")
print("5.Changing Account number ")

print("==========================================================
======================")

r=int(input("Enter your choice:"))

print("==========================================================
======================")

if r==1:
amt=int(input("Enter the money to be deposited:"))

print("==========================================================
======================")

sr="update record set CR_AMT=CR_AMT + {} where


ACCONT_NO={}".format(amt,acct)
c1.execute(sr)
conn.commit()
ef="update record set balance=cr_amt-withdrawl where
7|Page
ACCONT_NO={}".format(acct)
c1.execute(ef)
conn.commit()
print("successfully deposited")

t=input("Do you want to continue y/n -")

print("==========================================================
======================")

if t=="y":
continue
else:
print(" Thank you")

if r==2:
amt=int(input("Enter the money to withdraw:"))

print("==========================================================
======================")

ah="select BALANCE from record where


accont_no={}".format(acct)
c1.execute(ah)
m=c1.fetchone()
if amt >m[0]:
print("Your are having less than",amt)
print("Please try again")

print("==========================================================
======================")

else:
sr="update record set balance=balance - {} where
ACCONT_NO={}".format(amt,acct)
8|Page
ed="update record set WITHDRAWL ={} where
ACCONT_NO={}".format(amt,acct)
c1.execute(ed)
c1.execute(sr)
conn.commit()
print("Successfully updatad")
y=input("do you want to continue y/n -")
if y=="y":
continue
else:
print(" Thank you")

if r==3:
act=int(input("Enter the account number in which money to be
transferred :"))

print("==========================================================
======================")

cb="select * from record 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 :"))

print("==========================================================
======================")

ah="select BALANCE from record where


accont_no={}".format(acct)
9|Page
c1.execute(ah)
c=c1.fetchone()
if m > c[0]:
print("You are having less than",m)
print("Please try again")

print("==========================================================
======================")

else:
av="update record set balance=balance-{} where
ACCONT_NO={}".format(m,acct)
cv="update record set balance=balance+{} where
ACCONT_NO={}".format(m,act)
w="update record set withdrawl=withdrawl+{} where
accont_no={}".format(m,acct)
t="update record set CR_AMT=CR_AMT+{} where
accont_no={}".format(m,act)
c1.execute(av)
c1.execute(cv)
c1.execute(w)
c1.execute(t)
conn.commit()
print("Successfully transferred")
y=input("do you want to continue y/n -")
if y=="y":
continue
else:
print(" Thank you")

if r==4:
ma="select balance from record where accont_no={}".format(acct)
c1.execute(ma)
k=c1.fetchone()
10 | P a g e
print("Balance in your account=",k)

print("==========================================================
======================")

y=input("do you want to continue y/n -")


if y=="y":
continue
else:
print(" Thank you")

if r==5:
i=int(input("Enter your new account number:"))
cb="select * from record where ACCONT_NO={}".format(i)
c1.execute(cb)
c1.fetchall()
data=c1.rowcount
if data==1:
print("This number already exists")
print("Try again")

y=input("do you want to continue y/n -")


if y=="y":
continue
else:
print(" Thank you")

else:
name=input("Enter your name")
ar="Update record set accont_no={} where name='{}' and
password={}".format(i,name,pas)
c1.execute(ar)
conn.commit()
print("Your new account number is ",i)

11 | P a g e
else:
print("Wrong password")

print("==========================================================
======================")

y=input("do you want to continue y/n -")

else:
print("your Account does not exists")

if op==3:
print("Exiting")

c1.close()

12 | P a g e
OUTPUTs
…...............................................................
CREATE ACCOUNT

13 | P a g e
LOGIN

DEPOSIT MONEY

14 | P a g e
WITHDRAW MONEY

TRANSFER MONEY

15 | P a g e
CHECK BALANCE

CHANGE ACCOUNT NUMBER

16 | P a g e
HARDWARE AND SOFTWARE REQUIREMENTS
I.OPERATING SYSTEM : WINDOWS 7 AND ABOVE

II. PROCESSOR : PENTIUM (ANY) OR AMD

ATHALON(3800+- 4200+ DUALCORE)

III. MOTHERBOARD : 1.845 OR 915,995 FOR PENTIUM 0R MSI

K9MM-V VIAK8M800+8237R PLUS CHIPSET

FOR AMD ATHALON

IV. RAM : 512MB+

V. Hard disk : SATA 40 GB OR ABOVE

VI. CD/DVD r/w multi drive combo: (If back up required)

VII. FLOPPY DRIVE 1.44 MB : (If Backup required)

VIII. MONITOR 14.1 or 15 -17 inch

IX. Key board and mouse

X. Printer : (if print is required – [Hard copy])

SOFTWARE REQUIREMENTS:
I. Windows OS
II. Python
III. MySQL

17 | P a g e
BIBLIOGRAPHY

1. Computer science With Python - Class XI and XII By :


Sumita Arora
2. Websites-
 For Python concepts –
https://www.w3schools.com
 For MySQL concepts -
https://www.tutorialspoint.com/mysql/index.htm

***************

18 | P a g e

You might also like