0% found this document useful (0 votes)
4 views

project

computer science project for board class 12 very helpfull
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

project

computer science project for board class 12 very helpfull
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

COMPUTER project

FILE

PYTHON
NAME:-SAMRIDDHI VERMA
CLASS:-XII-D
SUBJECT:-COMPUTER SCIENCE

SUBJECT TEACHER NAME:-Mrs.


Ritu Kapoor Ma'am

CERTIFICATE
[1]

LUCKNOW PUBLIC COLLEGE


Lucknow Public College
Vinarm Khand, Gomti Nagar

This is to certify that SAMRIDDHI VERMA student of


class XII-D has successfully completed the computer
science project in the guidance of Mrs.Ritu Kapoor in
the year 2023-2024.

---------------------- ------------------------
TEACHER SIGNATURE PRINCIPAL
SIGNATURE

[2]

LUCKNOW PUBLIC COLLEGE


REQUIREMENT
HARDWARE:-
64-BITS DESKTOP WITH WINDOWS 7
OPERATING SYSTEM

SOFTWARE:-
PYTHON 3.8.10

[3]

LUCKNOW PUBLIC COLLEGE


BANK MANAGEMENT
SYSTEM:-
import pickle
import os
def new():
f=open("newaccount.dat","ab")
y=input("enter account
number")
u=input("enter account holder
name")
i=input("enter contact number")
t=int(input("enter new account
money"))
x=[y,u,i,t]
pickle.dump(x,f)
f.close()

[4]

LUCKNOW PUBLIC COLLEGE


def disp():
f=open("newaccount.dat","rb")
try:
while True:
p=pickle.load(f)
print(p)
except EOFError:
f.close()
def search():
u=input("enter account
number")
f=open("newaccount.dat","rb")
try:
while True:
p=pickle.load(f)
if p[0]==u:
for j in p:
[5]

LUCKNOW PUBLIC COLLEGE


print(j)
except EOFError:
f.close()
def deposit():
n=input("enter account number
")
am=int(input("enter amount "))
f=open("newaccount.dat","rb+")
try:
while True:
p1=f.tell()
x=pickle.load(f)
if x[0]==n:
x[3]=am+int(x[3])
f.seek(p1)
pickle.dump(x,f)
f.close()
[6]

LUCKNOW PUBLIC COLLEGE


break
except EOFError:
print("account not found")
f.close()
def withdr():
n=input("enter account number
")
am=int(input("enter amount "))
f=open("newaccount.dat","rb+")
try:
while True:
p1=f.tell()
x=pickle.load(f)
if x[0]==n:
if int(x[3])-am>=1000:
x[3]=int(x[3])-am
f.seek(p1)
[7]

LUCKNOW PUBLIC COLLEGE


pickle.dump(x,f)
f.close()
break
else:
print("balance is less
than 1000 rupees")
except EOFError:
print("account not found")
f.close()
def remove():
am=input("ënter account
number")
f=open("newaccount.dat","rb")
f1=open("temp.dat","wb")
try:
while True:
x=pickle.load(f)
[8]

LUCKNOW PUBLIC COLLEGE


if x[0]!=am:
pickle.dump(x,f1)
except EOFError:
f.close()
f1.close()
os.remove("newaccount.dat")

os.rename("temp.dat","newaccount
.dat")
while True:
print("1.add new account")
print("2.display all ")
print("3.search a account")
print("4.deposit")
print("5.withdraw")
print("6.remove an account")
print("7.quit")
[9]

LUCKNOW PUBLIC COLLEGE


n=int(input("enter the choice"))
if n==1:
new()
if n==2:
disp()
if n==3:
search()
if n==4:
deposit()
if n==5:
withdr()
if n==6:
remove()
if n==7:
break

OUTPUT OF THE CODE:-


[10]

LUCKNOW PUBLIC COLLEGE


1.add new account
2.display all
3.search a account
4.deposit
5.withdraw
6.remove an account
7.quit
enter the choice1
enter account number123123
enter account holder namesariddhi verma
enter contact number7897896543
enter new account money12123
1.add new account
2.display all
3.search a account
4.deposit
5.withdraw
6.remove an account
7.quit
enter the choice2
[11]

LUCKNOW PUBLIC COLLEGE


['123123', 'sariddhi verma', '7897896543', 12123]
1.add new account
2.display all
3.search a account
4.deposit
5.withdraw
6.remove an account
7.quit
enter the choice4
enter account number 123123
enter amount 122
1.add new account
2.display all
3.search a account
4.deposit
5.withdraw
6.remove an account
7.quit
enter the choice2
['123123', 'sariddhi verma', '7897896543', 12245]
[12]

LUCKNOW PUBLIC COLLEGE


1.add new account
2.display all
3.search a account
4.deposit
5.withdraw
6.remove an account
7.quit
enter the choice5
enter account number 123123
enter amount 500
1.add new account
2.display all
3.search a account
4.deposit
5.withdraw
6.remove an account
7.quit
enter the choice2
['123123', 'sariddhi verma', '7897896543', 11745]
1.add new account
[13]

LUCKNOW PUBLIC COLLEGE


2.display all
3.search a account
4.deposit
5.withdraw
6.remove an account
7.quit
enter the choice3
enter account number123123
123123
sariddhi verma
7897896543
11745
1.add new account
2.display all
3.search a account
4.deposit
5.withdraw
6.remove an account
7.quit
enter the choice6
[14]

LUCKNOW PUBLIC COLLEGE


ënter account number123123
1.add new account
2.display all
3.search a account
4.deposit
5.withdraw
6.remove an account
7.quit
enter the choice2
1.add new account
2.display all
3.search a account
4.deposit
5.withdraw
6.remove an account
7.quit
enter the choice7
>>>

[15]

LUCKNOW PUBLIC COLLEGE


[16]

LUCKNOW PUBLIC COLLEGE

You might also like