CS Project
CS Project
DATE:
XII—A2
CERTIFICATE
SIGNATURE
import os
ch = ’y’
I = open(’”MyfiIe.dat","ab’”l
n = Inc(inpu\("uow many records "))
for i In range(n).
rol=l int(Input(’”Enter Roll = "}}
name = input(" Enter name= ’”)
address = inpurl’”Enrer address = "}
Ren r = inr(inpu t ("Enter rhe renr = ” l
I
I closel)
I = open("MyfiTe dat","rb"}
while True!
try:
L = pickle.load(f)
print("File end")
break
f.close()
if x == 3.
f = open("Myfile.dat","rb")
print("
L = {]
S:0
while Irue:
L = pickle.load(f)
if Branch == L[4|:
print("
f.close()
prInt\” Sum of Rent of ”,Branch," Is = ",5)
if x -- 4:
f = open(”My6Ie.dat","rb")
f1 = openl"temp.dat","wb")
x = IntlInput("enter Roll no to be deleted "))
while True:
L = pickle.load(fl
If L|0|I=x:
pickle.dump(L,f1)
except EOFError:
print("FIIe end”l
f.cIosel)
os.remove("MyfiIe.dat") os.renamel”temp.dat”,”Myf!
Ie.dat")
f = open(”My6Ie.dat","rb")
f1 = openl"temp.dat","wb")
x = IntlInput("Enter Roll no whose rent need to be Increase "))
while True:
L = pickle.load(fl
L|3) = L[3)*500
pickle.dump(L,f1)
pickle.dump(L,f1)
except EOFError:
prlnt("FIle end”l
break
os.remove("MyfiIe.dat")
os.renamel”temp.dat”,”Myf!Ie.dat")
f = open(”prokssor.dat","wb")
n = Int(Input("How many records "))
for I In range(n):
Pno = IntlInput("Enter professor No = "))
Pname = Input("Enter prokssor name = ")
Dept = Input("Enter department= "l
Salary = Int(Inputl”Enter the Salary = "))
L = [Pno,Pname,Oept,5aIary|
pickle.dump(L,fl
f.cIosel)
I = open(”My0Ie.dat","rb")
II = openl"professor.det","rb"I
n = Int(input("enter roll no whose record Is required ”II
Temp = []
FIag1 = 0
while True:
L = pi‹kle.load(f)
if n == L|0]:
Temp = L
b eat
while True:
M = pickle.toadtf1)
if M{0| == 7emp}S ]-
£Iag1=1
extept EOFEr or.-
break
if F la g1==0:
f.close(]
ft close()
7. Enter the roll and display the student name aIc•ng with professor name and department
Enter Rail = 2
Enter Rail = 3
*.Tocreateatleofstudents
7. Enter the roll and display the student name along with professor name and department
Roll number 1
Branch cs
nome no 283737
Roll number 2
Home no 303892
Roll Number 3
Name almaas
Rent 4£XAI
Branch automobile
Home no 292
Roll Number 1
Name mohlt
Home no ZO2B7
Rsnt 3OOO
Home no 2B2
Branch aut•m•biIe
Home no 3029
File end
7. Enter the roTT and display the student name along with professor name and department
200o
kar
Program finishedj
BIBLIOGRAPH
Help from the internet,
Following website links have been
Used in the completion of this project:-