student marksheet(Sarthak Awasthi)
student marksheet(Sarthak Awasthi)
student marksheet(Sarthak Awasthi)
PUBLIC SCHOOL
PROJECT REPORT
on
‘STUDENT MARKSHEET’
SUBMITTED BY: -
NAME : Sarthak Awasthi
CLASS : XII-B ROLL.NO: …………….
UNDER THE GUIDANCE OF: Ms.RITA SEGAN
CERTIFICATE
‘Student Marksheet’
guidance.
………………………… ……………………………..
Signature of Student Signature of
Teacher
SARTHAK AWASTHI
Class XII B
C O N T E N T S
1. Introduction-------------------------------------------------------Page No
3. System Implementation---------------------------------------------------
4. Theoretical Background------------------------------------
6. Output------------------------------------------------------------------------
7. References -------------------------------------------------------------------
1. Introduction
proper way.
3. System Implementation
The Hardware and Software used:
Hardware Requirement-
• Intel Pentium/Celeron or similar processor based PC at
Client/Server end.
• 128 MB RAM and 4GB HDD space (for Database) is
desirable.
• Standard I/O devices like Keyboard and Mouse etc.
• Printer is needed for hard-copy reports.
• Local Area Network(LAN) is required for Client-Server
Installation
Software Requirement-
• Microsoft Windows® 7 or Higher Version as Operating
System.
• Python 3.7.2 as Front-end Development environment.
• MySQL as Back-end Sever with Database for Testing.
• MS-Word 2010 for documentation.
4. Theoretical Background
4.1 What is Database?
To find and retrieve just the data that meets conditions you
specify, including data from multiple tables, create a query. A
query can also update or delete multiple records at the same
time, and perform built-in or custom calculations on your data.
Role of RDBMS Application Program:
A computer database works as an electronic filing system,
which has a large number of ways of cross-referencing, and this
allows the user many different ways in which to re-organize and
retrieve data. A database can handle business inventory,
accounting and filing and use the information in its files to
prepare summaries, estimates and other reports. The
management of data in a database system is done by means of
a general-purpose software package called a Database
Management System (DBMS). Some commercially available
DBMS are MS SQL Server, MS ACCESS, INGRES, ORACLE, and
Sybase. A database management system, therefore, is a
combination of hardware and software that can be used to set
up and monitor a database, and can manage the updating and
retrieval of database that has been stored in it. Most of the
database management systems have the following capabilities:
Installing Python:
It can be installed by using website :
https://www.python.org/downloads/
Table Design:
For example BUT PUT ACCORDING TO YOUR PROJECT
File:- A file is a collection of related data stored in a particular area on the disk.
Source Code:
Source code
import pickle
def add_rec():
f=open("students.dat","wb")
rec=[]
while True:
roll=int(input("Enter roll no"))
name=input("enter the name of student")
physics=float(input("Enter marks of physics"))
chemistry=float(input("Enter marks of chemistry"))
maths=float(input("Enter marks of maths"))
computer=float(input("Enter marks of computer"))
english=float(input("Enter marks of english"))
total=physics+chemistry+maths+computer+english
per=total/5
if(per>=90):
grade="A1"
elif(per>=80 and per<90):
grade="A2"
elif(per>=70 and per<80):
grade="B1"
elif(per>=60 and per<70):
grade="B2"
else:
grade="C"
data=[roll,name,physics,chemistry,maths,computer,english,total,per,grade]
rec.append(data)
ch=input("Do you want to enter more records(y/n)")
if ch =="n" or ch=="N":
break
pickle.dump(rec,f)
print("Records added successfully")
f.close()
def display_rec():
print("Contents in file are:")
f=open("students.dat","rb")
try:
while True:
s=pickle.load(f)
count=1
for i in s:
print("***************Record of stuident:",count,"****************")
print("Roll number:",i[0])
print("Name of student:",i[1])
print("Marks in physics:",i[2])
print("Marks in chemistry:",i[3])
print("Marks in maths:",i[4])
print("Marks in Computer:",i[5])
print("Marks in english:",i[6])
print("Total Marks of student in 5 subjects:",i[7])
print("Percentage :",i[8])
print("Grade of student:",i[9])
count=count+1
except:
f.close()
def append_rec():
f=open("students.dat","rb+")
print("append records in the file:")
rec=pickle.load(f)
while True:
roll=int(input("Enter roll no"))
name=input("enter the name of student")
physics=float(input("Enter marks of physics"))
chemistry=float(input("Enter marks of chemistry"))
maths=float(input("Enter marks of maths"))
computer=float(input("Enter marks of computer"))
english=float(input("Enter marks of english"))
total=physics+chemistry+maths+computer+english
per=total/5
if(per>=90):
grade="A1"
elif(per>=80 and per<90):
grade="A2"
elif(per>=70 and per<80):
grade="B1"
elif(per>=60 and per<70):
grade="B2"
else:
grade="C"
data=[roll,name,physics,chemistry,maths,computer,english,total,per,grade]
rec.append(data)
ch=input("Do you want to enter more records(y/n)")
if ch =="n" or ch=="N":
break
f.seek(0)
pickle.dump(rec,f)
print("Records appended successfully")
f.close()
def search_roll():
f=open("students.dat","rb")
r=int(input("Enter roll number of student whose record u want to search:"))
found=0
try:
while True:
s=pickle.load(f)
count=1
for i in s:
if i[0]==r:
print("Record found and details of student are:")
print("Roll number:",i[0])
print("Name of student:",i[1])
print("Marks in physics:",i[2])
print("Marks in chemistry:",i[3])
print("Marks in maths:",i[4])
print("Marks in Computer:",i[5])
print("Marks in english:",i[6])
print("Total Marks of student in 5 subjects:",i[7])
print("Percentage :",i[8])
print("Grade of student:",i[9])
found=1
except:
f.close()
if found==0:
print("sorry...record not found.")
def search_name():
f=open("students.dat","rb")
n=input("Enter name of student whose record u want to search:")
found=0
try:
while True:
s=pickle.load(f)
count=1
for i in s:
if i[1]==n:
print("Record found and details of student are:")
print("Roll number:",i[0])
print("Name of student:",i[1])
print("Marks in physics:",i[2])
print("Marks in chemistry:",i[3])
print("Marks in maths:",i[4])
print("Marks in Computer:",i[5])
print("Marks in english:",i[6])
print("Total Marks of student in 5 subjects:",i[7])
print("Percentage :",i[8])
print("Grade of student:",i[9])
found=1
except:
f.close()
if found==0:
print("sorry...record not found.")
def modifyby_roll():
f=open("students.dat","rb+")
r=int(input("Enter roll number of student whose details u want to modify:"))
f.seek(0)
try:
while True:
rpos=f.tell()
s=pickle.load(f)
for i in s:
if i[0]==r:
i[1]=input("enter new name of student ")
i[2]=float(input("Enter new marks of physics "))
i[3]=float(input("Enter new marks of chemistry "))
i[4]=float(input("Enter new marks of maths "))
i[5]=float(input("Enter new marks of computer "))
i[6]=float(input("Enter new marks of english "))
i[7]=i[2]+i[3]+i[4]+i[5]+i[6]
i[8]=i[7]/5
if(i[8]>=90):
i[9]="A1"
elif(i[8]>=80 and i[8]<90):
i[9]="A2"
elif(i[8]>=70 and i[8]<80):
i[9]="B1"
elif(i[8]>=60 and i[8]<70):
i[9]="B2"
else:
i[9]="C"
f.seek(rpos)
pickle.dump(s,f)
def deleteby_roll():
f=open("students.dat","rb")
s=pickle.load(f)
f.close()
found=0
r=int(input("Enter roll no whose detail u want to delete:"))
f=open("students.dat","wb")
reclst=[]
for i in s:
if i[0]==r:
found=1
print("Record deleted successfully..")
continue
reclst.append(i)
pickle.dump(reclst,f)
if found==0:
print("Sorry!!record not found..")
f.close()
def menu():
while True:
print(""" Main Menu
1. Add record
2. Display all records
3. Append Records
4. Search by rollno
5. Search by name
6. Modify by rollno
7. Delete by rollno
8. Exit
""")
print(110*"=")
ch=int(input("Enter your choice"))
print(110*"=")
if(ch==1):
add_rec()
elif(ch==2):
display_rec()
elif(ch==3):
append_rec()
elif(ch==4):
search_roll()
elif(ch==5):
search_name()
elif(ch==6):
modifyby_roll()
elif(ch==7):
deleteby_roll()
elif(ch==8):
print("END")
break
else:
print("Enter any valid choice from 1-8")
menu()
6.Output
Main Menu
Adding Records
Displaying Records
Appending Records
Searching record by Roll number
Searching record by name
Deleting record
7. References
In order to work on this project titled –Student Marksheet, the following books and
literature are referred by me during the various phases of development of the
project:
(3) http://www.mysql.org/
(4) http://www.python.org/
(5) Various Websites of Discussion Forum and software development activities.