Project Final...
Project Final...
Project Final...
Sivananainthapuram
COMPUTER REPORT
SIGNATURE SIGNATURE
Mr.P.Muthu Kumar .M.Sc.,B.Ed., Mr.P.Sankardayal.M.E.,B.Ed.,
PRINCIPAL PGT COMPUTER TEACHER
SER DESCRIPTION
01 ACKNOWLEGEMENT
02 INTRODUCTION
03 OBJECTIVES
06 FUNCTIONS
07 TESTING
08 SOURCE CODE
09 OUTPUT
10 ADVANTAGES & DISADVANTAGES
11 CONCLUSION
12 BIBLIOGRAPHY
ACKNOWLEDGEMENT
I take this opportunity to put record our sincere thanks to all who
enlightened my path towards the successful completion of this project.
At the very outset, I thank the almighty for this abundant blessings showered on
me.
It is my greatest privilege to convey my thanks to Mr.P.Muthu Kumar.M.Sc.,
B.Ed., Principal, Shrikarra Vidhya Mandhir for having provided me with all
required facilities to complete my project without hurdles.
I thank my guide Mr.P.Sankardayal.M.E.,B.Ed., PGT, Teacher of
Computer Science for his excellent guidance patiently throughout my project work
and for having helped me with excellent suggestions and hints, which facilitated
my task very much.
available,False otherwise .
3. cursor( ) : They are bound to the connection for the entire life
time and all the commands are executed in the context of the
available.
execute( ) method for the same cursor( ) object and thus returns
for i in range(2):
print()
import mysql.connector
from datetime import date
from time import sleep
print("======WELCOME TO SVRR BANK OF GOA======")
def clear():
print()
print("Loading.......")
print("Please Wait.......")
sleep(2)
print()
def customer_record():
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='sakthi')
cursor = conn.cursor()
sql ="select * from customer;"
cursor.execute(sql)
results = cursor.fetchall()
clear()
print('Customer Records')
print('-'*120)
for result in results:
print(result[0], result[1], result[2], result[3], result[4],
result[5],result[6], result[7], result[8])
print('-'*120)
conn.close()
wait = input(' Press any key to continue....')
print("="*60)
def account_status(acno):
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='sakthi')
cursor = conn.cursor()
sql ="select status,balance from customer where acno ='"+acno+"'"
result = cursor.execute(sql)
result = cursor.fetchone()
conn.close()
return result
def deposit_amount():
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='sakthi')
cursor = conn.cursor()
clear()
acno = input('Enter account No :')
amount = input('Enter amount :')
today = date.today()
result = account_status(acno)
if result==None:
print("\n\nINVALID...!ACCOUNT NUMBER")
elif result [0]== 'active':
sql1 ="update customer set balance = balance+"+amount + '
where acno = '+acno+' and status="active";'
sql2 = 'insert into transaction(amount,type,acno,dot) values(' +
amount +',"deposit",'+acno+',"'+str(today)+'");'
cursor.execute(sql2)
cursor.execute(sql1)
conn.commit()
#print(sql1)
#print(sql2)
print('\n\namount deposited')
print()
print()
else:
print('\n\nClosed or Suspended Account....')
def withdraw_amount():
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='sakthi')
cursor = conn.cursor()
clear()
acno = input('Enter account No :')
amount = input('Enter amount :')
today = date.today()
result = account_status(acno)
if result == None:
print("\n\nINVALID...!ACCOUNT NUMBER")
cursor.execute(sql2)
cursor.execute(sql1)
conn.commit()
#print(sql1)
#print(sql2)
print('\n\nAmount Withdrawn')
else:
print('\n\nClosed or Suspended Account.Or Insufficient amount')
def transaction_menu():
while True:
clear()
print(' Trasaction Menu')
print("\n1. Deposit Amount")
print('\n2. WithDraw Amount')
print('\n3. Back to Main Menu')
print('\n\n')
choice = int(input('Enter your choice ...: '))
if choice == 1:
deposit_amount()
if choice == 2:
withdraw_amount()
if choice == 3:
break
def search_menu():
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='sakthi')
cursor = conn.cursor()
while True:
clear()
print(' Search Menu')
print("\n1. Account No")
print('\n2. Aadhar Card')
print('\n3. Phone No')
print('\n4. Email')
print('\n5. Names')
print('\n6. Back to Main Menu')
print('\n\n')
choice = int(input('Enter your choice ...: '))
field_name=''
if choice == 1:
field_name ='acno'
if choice == 2:
field_name ='aadhar_no'
if choice == 3:
field_name = 'phone'
if choice == 4:
field_name = 'email'
if choice == 5:
field_name = 'name'
if choice == 6:
break
msg ='Enter '+field_name+': '
value = input(msg)
if field_name=='acno':
sql = 'select * from customer where '+field_name + ' = '+value+';'
else:
sql = 'select * from customer where '+field_name +' like
"%'+value+'%";'
#print(sql)
cursor.execute(sql)
records = cursor.fetchall()
n = len(records)
clear()
print('Search Result for ', field_name, ' ',value)
print('-'*80)
for record in records:
print("| ACCOUNT NO :",record[0],"|"," NAME
:",record[1],"|", " ADDRESS :",record[2],"|","PHONE
:",record[3],"|","EMAIL ID :",record[4],"|","AADHAR NO
:",record[5],"|","ACCOUNT TYPE :",record[6],"|","STATUS
:",record[7],"|","BALANCE :", record[8],"|")
if(n <= 0):
print(field_name, ' ', value, ' does not exist')
wait = input('Press any key to continue....')
print("="*60)
conn.close()
wait=input('Press any key to continue....')
print("="*60)
def daily_report():
clear()
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='sakthi')
today = date.today()
cursor = conn.cursor()
sql = 'select tid,dot,amount,type,acno from transaction t where
dot="'+ str(today)+'";'
cursor.execute(sql)
records = cursor.fetchall()
clear()
print('Daily Report :',today)
print('-'*120)
for record in records:
print(record[0], record[1], record[2], record[3], record[4])
print('-'*120)
conn.close()
wait = input('Press any key to continue....')
print("="*60)
def monthly_report():
clear()
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='sakthi')
today = date.today()
cursor = conn.cursor()
sql = 'select tid,dot,amount,type,acno from transaction t where
month(dot)="' + \
str(today).split('-')[1]+'";'
cursor.execute(sql)
records = cursor.fetchall()
clear()
#print(sql)
print('Monthly Report :', str(today).split('-')[1], '-',
str(today).split('-')[0])
print('-'*120)
for record in records:
print(record[0], record[1], record[2], record[3], record[4])
print('-'*120)
conn.close()
wait = input('Press any key to continue....')
print("="*60)
def account_details():
clear()
acno = input('Enter account no :')
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='sakthi')
cursor = conn.cursor()
sql ='select * from customer where acno ='+acno+';'
sql1 = 'select tid,dot,amount,type from transaction t where
t.acno='+acno+';'
cursor.execute(sql)
result = cursor.fetchone()
clear()
print('Account Details')
print('-'*120)
print('Account No :',result[0])
print('Customer Name :',result[1])
print('Address :',result[2])
print('Phone NO :',result[3])
print('Email ID :',result[4])
print('Aadhar No :',result[5])
print('Account Type :',result[6])
print('Account Status :',result[7])
print('Current Balance :',result[8])
print('-'*120)
cursor.execute(sql1)
results = cursor.fetchall()
print("######## ACCOUNT HISTORY #########")
for result in results:
print(result[1], result[2], result[3])
conn.close()
print()
print()
wait=input('Press any key to continue.....')
print("="*60)
def report_menu():
while True:
clear()
print(' Report Menu')
print("\n1. Daily Report")
print('\n2. Monthly Report')
print('\n3. Account Details')
print('\n4. Customer Records')
print('\n5. Back to Main Menu')
print('\n\n')
choice = int(input('Enter your choice ...: '))
if choice == 1:
daily_report()
if choice == 2:
monthly_report()
if choice == 3:
account_details()
if choice == 4:
customer_record()
if choice == 5:
break
def add_account():
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='sakthi')
cursor = conn.cursor()
acno = input('Enter Account no:')
name = input('Enter Name :')
addr = input('Enter address ')
phone = input('Enter Phone no :')
email = input('Enter Email :')
aadhar = input('Enter AAdhar no :')
actype = input('Account Type (saving/current ) :')
balance = input('Enter opening balance :')
sql = 'insert into
customer(acno,name,address,phone,email,aadhar_no,acc_type,balanc
e,status) values ( "'+acno + '","'+ name +'","'+
addr+'","'+phone+'","'+email+'","'+aadhar+'","'+actype+'",'+bala
nce+',"active" );'
#print(sql)
cursor.execute(sql)
conn.commit()
conn.close()
print('\n\nNew customer added successfully')
wait= input('Press any key to continue....')
print("="*60)
def modify_account():
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='sakthi')
cursor = conn.cursor()
clear()
acno = input('Enter customer Account No :')
print()
print()
print('Modify screen ')
print('\n 1. Customer Name')
print('\n 2. Customer Address')
print('\n 3. Customer Phone No')
print('\n 4. Customer Email ID')
print()
print()
choice = int(input('What do you want to change ? '))
new_data = input('Enter New value :')
field_name=''
if choice == 1:
field_name ='name'
if choice == 2:
field_name = 'address'
if choice == 3:
field_name = 'phone'
if choice == 4:
field_name = 'email'
sql ='update customer set ' + field_name + '="'+ new_data +'"
where acno='+ acno +';'
#print(sql)
cursor.execute(sql)
conn.commit()
print('\n\nCustomer Information modified..')
print()
wait = input('Press any key to continue....')
print("="*60)
def close_account():
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='sakthi')
cursor = conn.cursor()
clear()
acno = input('Enter customer Account No :')
sql ='update customer set status="close" where acno ='+acno+';'
cursor.execute(sql)
conn.commit()
print('\n\nAccount closed')
wait = input('Press any key to continue....')
print("="*60)
def activate_account():
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='sakthi')
cursor = conn.cursor()
clear()
acno = input('Enter customer Account No :')
sql = 'update customer set status="active" where acno ='+acno+';'
cursor.execute(sql)
conn.commit()
print('\n\nAccount Activated')
wait = input('Press any key to continue....')
print("="*60)
def main_menu():
while True:
clear()
print()
print("="*60)
print(' Main Menu')
print("\n1. Add Account")
print('\n2. Modify Account')
print('\n3. Close Account')
print('\n4. Activate Account')
print('\n5. Transaction Menu')
print('\n6. Search Menu')
print('\n7. Report Menu')
print('\n8. Close application')
print("="*60)
print('\n\n')
choice = int(input('Enter your choice ...: '))
if choice == 1:
add_account()
if choice == 2:
modify_account()
if choice == 3:
close_account()
if choice == 4:
activate_account()
if choice ==5 :
transaction_menu()
if choice ==6 :
search_menu()
if choice == 7:
report_menu()
if choice ==8:
print("<< THANK YOU FOR USING OUR APPLICATION>>")
break
if __name__ == "__main__":
main_menu()
OUTPUT
Output:
ADVANTAGES
&
DISADVANTAGES
Advantages & Disadvantages :
The black box tester has no "bonds" with the code, and a
tester's perception is very simple: a code must have bugs.
Using the principle, "Ask and you shall receive," black box
testers find bugs where programmers don't. But, on the other
hand, black box testing has been said to be "like a walk in a
dark labyrinth without a flashlight," because the tester
doesn't know how the software being tested was actually
constructed.
That's why there are situations when
(1) A black box tester writes many test cases to check
something that can be tested by only one test cases.
(2) Some parts of the back end are not tested at all.
Therefore, black box testing has the advantage of "an
unaffiliated opinion," on the one hand, and the disadvantage
of "blind exploring," on the other.
CONCLUSION
Conclusion:
The project was successfully executed without any lag and met all
our expectations and in future it will help to improve some applications.
This is the end of the project. We‟ve explored the big ideas of
composition of functions, functions as data, recursion, abstraction, and
sequential programming. As a review, you might ensure that our project
has something special. The project had been completed due to the hard
efforts taken by us and we had faced many difficulties while doing this
project. This was a great experience for us in learning
BIBLIOGRAPHY
Bibliography:
http://www.google.com/
http://en.wikipedia.org
http://www.geeksforgeeks.org/
https://github.com/
https://pythonprogramming.net/
https://www.edureka.co/
https://codescracker.com/
Computer science with Python by Sumita Arora
CLASS-XII
Computer science with Python by Preeti Arora
CLASS-XII
***********THANK YOU**********