Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

Computer

Science
Project

Submitted By:
Name:______________
Board Roll no: ____
“STUDENT
RECORD KEEPING
SYSTEM”

2021-2022
INDEX
1. ACKNOWLEDGEMENT
2. CERTIFICATE
3. PROJECT OBJECTIVE
4. HARDWARE AND SOFTWARE
REQUIREMENTS
5. INTRODUCTION TO LANGUAGE
USED
6. SOURCE CODE
7. OUTPUT
8. BIBLIOGRAPHY.
ACKNOWLEDGEMENT
I ,_____(Name) of class XII take this opportunity
to express my profound gratitude and deep
regards to my teacher Ms. Nimisha Sharma for
her exemplary guidance, monitoring and constant
encouragement throughout the course of this
project. The blessing, help and guidance given
by her time to time shall carry me a long way in
the journey of life on which I am about to
embark. Her encouragement and constant efforts
have enabled me to improve the quality of my
job.
CERTIFICATE
This is to certify that (Student Name) of class
XII of (school name) has completed his/her
project file under my guidance. He has taken
proper care and shown utmost sincerity in
completing this project. I certify that this
project is up to my expectations and as per the
guidelines issued by CBSE.

Mrs. Nimisha Sharma


(Computer Teacher)
OBJECTIVE

The purpose of this Project was to make use of


Python coding which will enable us to create
and store Student’s information in a file. It also
provides the facility to insert, modify and delete
the information of any particular student. The
details of any student can be searched and
displayed too. A huge volume of records can be
stored and manipulated using this code.
HARDWARE
AND SOFTWARE
REQUIREMENTS

1. Windows 10
2. RAM 512 to 4GB
3. HDD 40GB to 1TB
4. Python 3.6 to3.8
INTRODUCTION TO
LANGUAGE USED

Python is object-oriented high-level computer


language developed by Guido Van Rossum in
1990s. It was named after a British TV show
namely ‘Monty Python’s Flying circus’.
Features of Python: Python is a high-level
language. It is a free and open-source language. It
is an interpreted language, as python programs
are executed by an interpreter. Python programs
are easy to understand as they have a clearly
defined syntax and relatively simple structure.
Python is case sensitive. Python is portable
and platform independent means it can run
on various operating systems.
SOURCE CODE
import pickle
def write():
f= open("sample2.dat","wb")
record=[]
while True:
rno=int(input("enter roll number"))
name=input("enter name")
marks=int(input("enter marks"))
data=[rno,name,marks]
record.append(data)
ch=input("do u want to enter more records")
if ch=='n':
break
pickle.dump(record,f)
f.close()

def read():
print("contents in a file.....")
f=open("sample2.dat","rb")
while True:
s=pickle.load(f)
print(s)
for i in s:
print(i)
f.close()
def append():
f= open("sample1.dat","rb+")
rec=pickle.load(f)
while True:
rno=int(input("enter roll number"))
name=input("enter name")
marks=int(input("enter marks"))
data=[rno,name,marks]
rec.append(data)
ch=input("do u want to enter more records")
if ch is 'Nn':
break
f.seek(0)
pickle.dump(rec,f)

def search():
f=open("sample2.dat","rb")
s=pickle.load(f)
print(s)
found=0
rno=int(input("enter the roll number"))
for i in s:
if i[0]==rno:
print(i)
found=1
if found==0:
print("record not found")
def update():
f=open("sample1.dat","rb+")
s=pickle.load(f)
print(s)
found=0
rno=int(input("enter the roll number"))
for i in s:
if i[0]==rno:
print(i)
print("current name is:",i[1])
i[1]=input("enter new name")
found=1
break
if found==0:
print("record not found")
else:
f.seek(0)
pickle.dump(s,f)
def delete():
f=open("sample1.dat","rb")
s=pickle.load(f)
f.close()
r=int(input("enter roll number"))
f=open("sample1.dat","wb")
print(s)
recl=[]
for i in s:
if i[0]==r:
continue
recl.append()
f.seek(0)
pickle.dump(recl,f)
f.close()

def mainmenu():
print("------------main menu-----------")
print("1. write data in binary file")
print("2. read data from binary file")
print("3. Append data in a binary file")
print("4. search data from a binary file")
print("5. UPdate the data in binary file")
print("6. Delete the data in a binary file")
print("7. Exit from the program")
print("-------------------------------")
while True:
mainmenu()
ch=int(input("enter"))
if ch==1:
write()
elif ch==2:
read()
elif ch==3:
append()
elif ch==4:
search()
elif ch==5:
update()
elif ch==6:
delete()
elif ch==7:
break
OUTPUT

------------main menu-----------
1. write data in binary file
2. read data from binary file
3. Append data in a binary file
4. search data from a binary file
5. UPdate the data in binary file
6. Delete the data in a binary file
7. Exit from the program

enter your choice 1


Roll No1
Name:ram
Marks80
More(Y/N)y
Roll No2
Name:sita
Marks90
More(Y/N)y
Roll No3
Name:geeta
Marks90
More(Y/N)n
record added
do u want to remain in y
------------main menu-----------
1. write data in binary file
2. read data from binary file
3. Append data in a binary file
4. search data from a binary file
5. UPdate the data in binary file
6. Delete the data in a binary file
7. Exit from the program
enter your choice 2
Contents are.....
[[1, 'ram', 80], [2, 'sita', 90], [3, 'geeta', 90]]
[1, 'ram', 80]
[2, 'sita', 90]
[3, 'geeta', 90]
do u want to remain in
BIBLIOGRAPHY
1. Computer Science with PYTHON textbook for
class XII (Sumita Arora)
2. Computer Science with PYTHON practical book
for class XII(Sumita Arora)
3. Google

You might also like