0% found this document useful (0 votes)
15 views12 pages

CS Project

computer science project

Uploaded by

vibhutikaushik30
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views12 pages

CS Project

computer science project

Uploaded by

vibhutikaushik30
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

PROJECT

CLASS and SECTION: 12 " A2 BOARD ROLL NO:


SUBMITTED TO: GURVINDER KAUR
ACKNOWLEDGEMENT
I would like to express my special thanks of
Gratitude to my subject teacher "Mrs.
Gurvinder kaur" for her able guidance and
support in completing my project.

I would also like to extend my gratitude to the


principle ma’am "Mrs. Anita sharma"
For providing me with all the facility was
required.

DATE:

XII—A2
CERTIFICATE

This is to certify that Almaas of class-XII A2


Has successfully completed his project on
“Students record“ under the guidance of
Mrs.Gurvinder kaur(Subject teacher) during
year: 2023-24

SIGNATURE
import os

ch = ’y’

while ch == ’y’ or ch == 'Y’-


print{" i. To create a file of students ")

print{" 2. To read a Binary I-4e "l


print(" 3.7o Print report course wise "}
print{"4.7o delete a record from Binary File "}
print(" 5.7o Modify a record in a Binary File "}
printl"6 7o create a file of professors")
print{" 7. Enter the roll and dopIay the student name along with professor name and
department")
x = int(input(’”Enter your choice= ")l

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

BranCh = input(" Enter the branch /course= "}

T No = int(inpurl’”Enter the home telephone no" I}


L = [roll,name,address,Renr,Branch,T No|
pickIe.dump(L,f)

I closel)

I = open("MyfiTe dat","rb"}

while True!
try:

L = pickle.load(f)

print(" Roll Number ", L[0])

print(" rJame ". L[1j)

print{" addr ess ". L[2j)

print(" Rent ", L[3])

print(" Branch ", L[s])

print(" Home no ", Lfs])

extept E OFEr ror.

print("File end")

break

f.close()

if x == 3.

f = open("Myfile.dat","rb")

Branth = input("Input Branch whose repo t required " )

print("

L = {]

S:0

print(" Roll Name 0ee ”}

while Irue:

L = pickle.load(f)

if Branch == L[4|:

pr intt L{0 |, "


",L[1]." ",L[3])
S = S + L[3]

extept EOFEr ror -

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

excep\ EOF Error.

b eat

prinr{"S£udent does nor exist s")

while True:

M = pickle.toadtf1)

if M{0| == 7emp}S ]-

pi int t " Roll t4o ",1emp{0| ,


pi int {" St udent Name ",Temp {1|)i
print (" professor Name ",M[1|)

print (" Department ",M[2j)

£Iag1=1
extept EOFEr or.-

break

if F la g1==0:

print("professor Record does not exists")

f.close(]

ft close()

ch = input("Do You want to continue Y/N " )


1. 7o create a ii le of students

2. To read a 8inary File

3. To Print report course wise

4. To delete a record from 8inary File

5. To Modify a record In a 6inary File

6. To create a file of professors

7. Enter the roll and display the student name aIc•ng with professor name and department

Enter your chance = 1

How many records 3


Enter joli = 1

Enter name = mohit

Enter address = swaroop nagar

Enter the rent = 2000

Enter the branch /œurse= ce

Enter the home telephone no20287

Enter Rail = 2

Enter name = karan

Enter address = swaroop nagar

Enter the rent = 3000

Enter the branch /œurse= kabootar science

Enter the home telephone no0282

Enter Rail = 3

Enter name = almaas

Enter address = jahanglr purl

Enter the rent = 4000

Enter the branch /œurse= automobile


Errter the home telephone no3029

Do You warrt to continue Y/N y

*.Tocreateatleofstudents

2.To read a Binary File

3.To Print report course wise

o zo delete a record from einary File

s. To Modify a record in a einary File

6. zo create a file of professors

7. Enter the roll and display the student name along with professor name and department

Enter your choice = 2

Roll number 1

same mohit sharma

address swaroop nagar


kent 2IXI0

Branch cs

nome no 283737

Roll number 2

same karan sharma

Address swaroop nagar

Branch iit bombay kabootar science

Home no 303892

Roll Number 3

Name almaas

Address jahangir puri

Rent 4£XAI

Branch automobile

Home no 292

Roll Number 1

Name mohlt

Address swaroop nagar


eranch cs

Home no ZO2B7

Ad dress xwaroop nagar

Rsnt 3OOO

Branch kabootar science

Home no 2B2

Ad dress jah an gir puri

Branch aut•m•biIe
Home no 3029

File end

Do You want to congin u e Y/N y

1. To create a file o£ students

2. To read a Binary File

3. To Print report course wide

4. To dekte a record from Binary File

S. To Modify a record in a Binary File

6. To create a file o£ proWson

7. Enter the roTT and display the student name along with professor name and department

Enter your choice = 4

Gnp u t Bran th whole report requi red la bootar scion be

200o
kar

Sum of Rent of kebootar science is = 3trO0

Do You want to con6nue Y/N n

Program finishedj
BIBLIOGRAPH
Help from the internet,
Following website links have been
Used in the completion of this project:-

www.wiki edia.or www.youtube.com


www.csIearnin hub.com
www.Iearncbse.com

Also took some help from chat gpt.

You might also like