Cs Project
Cs Project
SESSION: - 2021-22
ROLL NO.: - 14609783
NAME: - TANISH RUSTAGI
CLASS: - XII - D
SUBJECT: - COMPUTER SCIENCE (083)
1
CERTIFICATE
This is to certify that student - TANISH RUSTAGI Roll No: -
SCHOOL on______________.
EXAMINER:
TEACHER:
DATE:
2
INDEX
2 INTRODUCTION 5
3 SOURCE CODE 6
4 OUTPUT 18
5 BIBLIOGRAPHY 30
3
ACKNOWLEDGEMENT
4
INTRODUCTION
The ATM MACHINE SOFTWARE is a device which is the same as
Balance.
5
SOURCE CODE
import mysql.connector as sql
conn=sql.connect(host='localhost',user='root',password='28092004',database='
ATM_MACHINE')
c1=conn.cursor()
print("=============================================================
===================")
print("=============================================================
===================")
6
if op==1:
c="y"
while c=="y":
m=int(input("Enter a 4 digit number as accont 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")
7
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)
conn.commit()
print("Account sucessfully created")
print("The minimum balance is 1000 ")
print("=============================================================
===================")
print("=============================================================
===================")
8
c1.execute(sr)
conn.commit()
ef="update records set balance=cr_amt-withdrawl where
ACCONT_NO={}".format(m)
c1.execute(ef)
conn.commit()
print("sucessfully deposited")
9
print("=============================================================
===================")
print("=============================================================
===================")
print("=============================================================
===================")
if r==1:
amt=int(input("Enter the money to be deposited:"))
10
print("=============================================================
===================")
print("=============================================================
===================")
if t=="y":
continue
else:
print(" Thank you")
print(" PLEASE CLOSE THIS FILE BEFORE EXITING")
if r==2:
11
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("Sucessfully updatad")
y=input("do you want to continue y/n -")
if y=="y":
12
continue
else:
print(" Thank you")
print(" PLEASE CLOSE THIS FILE BEFORE EXITING")
if r==3:
act=int(input("Enter the accont number to be transferrsd :"))
print("=============================================================
===================")
print("=============================================================
===================")
13
c1.execute(ah)
c=c1.fetchone()
if m > c[0]:
print("Your are having less than",m)
print("Please try again")
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 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)
conn.commit()
print("Sucessfully transfered")
y=input("do you want to continue y/n -")
14
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("=============================================================
===================")
15
c1.fetchall()
data=c1.rowcount
if data==1:
print("This number already exists")
print("Try again")
else:
print("Wrong password")
16
print("=============================================================
===================")
else:
print("your Account does not exists")
if op==3:
print("Exiting")
print("Please close this file before exiting.")
ch=input("Do you want to continue YES/NO-")
c1.close()
17
OUTPUT
18
19
20
21
22
23
24
25
26
27
28
29
BIBLIOGRAPHY
• Computer Science With Python - Class XI By: Sumita Arora
• Computer Science With Python - Class XII By: Sumita Arora
• Websites: https://www.w3resource.com
https://en.wikipedia.org/
https://geeksforgeeks.org/
30