Professional Documents
Culture Documents
In
COMPUTER SCIENCE (083)
By:
1. ADVITIYA SHARMA – XII A – ROLL NO: 01
2. AKSHIT WALIA – XII A – ROLL NO: 03
3. KARTIK CHAUHAN - XII A - ROLL NO: 09
4. SHUBHAM DOGRA – XII A – ROLL NO: 22
January, 2020
Place : Kendriya Vidyalaya Palampur
Mentor:
(LALIT KUMAR)
PRINCIPAL
KENDRIYA VIDYALAYA PALAMPUR
Project Guide:
Sanjeev Sharma
PGT-Computer Science
Kendriya Vidyalaya Palampur
Acknowledgements
3. Python Coding.
5. References.
Introduction of the Project
To perform this task the students were divided into the group of
four students named as ADVITIYA, AKSHIT, SHUBHAM.
We are so glad that this work have been assigned to us, yet we
haven’t done this work before SH. SANJEEV SHARMA our subject
teacher have also helped us a lot to complete this project. We feel
so blessed that we have learnt all this work with the help of our
sir,we are also thankful to our respected principal SH. LALIT
KUMAR GUPTA for providing us various facilities to complete this
project.
PROCESS
import mysql.connector
myConnnection =""
cursor=""
userName=""
password =""
cid=""
global myConnection
global userName
global password
myConnection=mysql.connector.connect(host="localhost",user=userName,passwd=password ,
auth_plugin='mysql_native_password' )
if myConnection:
print("\n CONGRATULATIONS ! YOUR MYSQL CONNECTION HAS BEEN ESTABLISHED !")
cursor=myConnection.cursor()
cursor.execute("COMMIT")
cursor.close()
return myConnection
else:
global userName
global password
global myConnection
myConnection=mysql.connector.connect(host="localhost",user=userName,passwd=password ,
database="ATM" , auth_plugin='mysql_native_password' )
if myConnection:
return myConnection
else:
myConnection.close()
def newCustomer():
global cid
if myConnection:
cursor=myConnection.cursor()
"""
cursor.execute(createTable)
values=(cid,cname,address,phone)
cursor.execute(sql,values)
cursor.execute("COMMIT")
cursor.close()
def displayAllCustomer():
if myConnection:
cursor=myConnection.cursor()
data = cursor.fetchall()
if data:
print(data)
else:
else:
def searchCustomer():
global cid
if myConnection:
cursor=myConnection.cursor()
values=(cid,)
data=cursor.execute(sql,values)
data = cursor.fetchall()
if data:
print("\n*****CUSTOMER DETAILS*****")
print(data)
else:
else:
def newAccount():
global cid
if myConnection:
cursor=myConnection.cursor()
values=(cid,)
data=cursor.execute(sql,values)
data = cursor.fetchall()
if data:
createTable ="""CREATE TABLE IF NOT EXISTS ACCOUNT(CID VARCHAR(10),ACCOUNT_NO INT
PRIMARY KEY
,ACCOUNT_TYPE VARCHAR(20) NOT NULL ,AMOUNT INT NOT NULL , PIN INT NOT NULL
UNIQUE)
"""
cursor.execute(createTable)
values1=(cid,account_no,account_type,amount,ATM_pin)
cursor.execute(sql,values1)
cursor.execute("COMMIT")
else:
else:
def displayAllAccounts():
if myConnection:
cursor=myConnection.cursor()
data = cursor.fetchall()
if data:
else:
else:
def searchAccount():
global cid
if myConnection:
cursor=myConnection.cursor()
values=(cid,account_no)
data=cursor.execute(sql,values)
data = cursor.fetchall()
if data:
print(data)
else:
else:
def withdrawAmount():
count =3
if myConnection:
cursor=myConnection.cursor()
values=(account_no,)
data=cursor.execute(sql,values)
data = cursor.fetchall()
if data:
while True:
ATM_PIN=int(input("PLEASE ENTER THE ATM PIN - ONLY 3 ATTEMPTS ARE ALLOWED : "))
values=(ATM_PIN,)
cursor.execute(sql,values)
data = cursor.fetchall()
if data:
cursor.execute(sql ,(amount,))
cursor.execute("COMMIT")
break
else:
count=count-1
if count == 0:
print("Your Card has been Blocked , Please Visit the Branch to activate it")
break
else:
def helpMe():
print("Please, Visit The Offcial Website Of Vidyalaya To Download The Mannual !!!")
# MAIN SCREEN
myConnection = MYSQLconnectionCheck ()
if myConnection:
MYSQLconnection ()
while(1):
print("\n!=========================*************=======================!")
print("\n!============================*****END*****====================!")
if choice == 1:
newCustomer()
elif choice == 2:
displayAllCustomer()
elif choice == 3:
searchCustomer()
elif choice == 4:
newAccount()
elif choice==5:
displayAllAccounts()
elif choice==6:
searchAccount()
elif choice==7:
withdrawAmount()
elif choice==8:
break
elif choice==0:
helpMe()
else:
print("Sorry ,May Be You Are Giving Me Wrong Input, Please Try Again !!! ")
else:
#(":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
#(" T H H A A N N N K K ")
#(" T H H A AN NK K Y O O U U ")
#(" Y O O U U ")
#(":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
MAIN SCREEN
STARTING OF SOFTWARE
FOR NEW USER
DISPLAY CUSTOMER DETAILS
TO SEARCH A CUSTOMER
TO OPEN NEW ACCOUNT
TO DISPLAY ALL ACCOUNTS
TO SEARCH AN ACCOUNT
TO WITHDRAW AMOUNT
BLOCKED PIN
TO EXIT
FOR HELP
DATABASE - ATM
TABLE STRUCTURE 1
TABLE STRUCTURE 2
BACKEND DATA GENERATED THROUGH
SOFTWARE
BACKEND DATA GENERATED THROUGH
SOFTWARE
References
1. python.org
2. Code Academy
3. tutorialsPoint.com
4. PythonChallenge.com
6. LearnPython.org
7. layak.in