Student Marksheet
Student Marksheet
PROJECT REPORT
on
‘Project Title’
SUBMITTED BY: -
NAME : …………………………………….……
CLASS : ………………… ROLL.NO: …………….
1
CERTIFICATE
‘Project Title’
………………………… ……………………………..
Signature of Student Signature of
Teacher
I
, undertook this Project work, as the part of my XII-
Computer Science. I had tried to apply my best of
knowledge and experience, gained during the study and
class work experience. However, developing software system
is generally a quite complex and time-consuming process. It
requires a systematic study, insight vision and professional
approach during the design and development. Moreover, the
developer always feels the need, the help and good wishes of
the people near you, who have considerable experience and
idea.
Name of Student
Class XII B
3
C O N T E N T S
1. Introduction-------------------------------------------------------Page No
3. System Implementation---------------------------------------------------
4. Theoretical Background------------------------------------
6. Output------------------------------------------------------------------------
7. References -------------------------------------------------------------------
4
1. Introduction
program is tied with the database for easy access and interface to
This project, being simple in design and working, does not require
7
3. System Implementation
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.
8
4. Theoretical Background
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.
9
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:
10
The DBMS interprets and processes users' requests to retrieve
information from a database. In most cases, a query request will
have to penetrate several layers of software in the DBMS and
operating system before the physical database can be accessed.
The DBMS responds to a query by invoking the appropriate
subprograms, each of which performs its special function to
interpret the query, or to locate the desired data in the database
and present it in the desired order.
13
MySQL client programs can be written in many languages. A
client library written in C is available for clients written in C
or C++, or for any language that provides C bindings.
APIs for C, C++, Eiffel, Java, Perl, PHP, Python, Ruby, and Tcl
are available, enabling MySQL clients to be written in many
languages.
The Connector/ODBC (MyODBC) interface provides MySQL
support for client programs that use ODBC (Open Database
Connectivity) connections.
The Connector/J interface provides MySQL support for Java
client programs that use JDBC connections. Clients can be
run on Windows or Unix. Connector/J source is available.
4.3What is Python ?
Python is an open source , object oriented high level
programming language developed by Guido Van Rossum in 1991
at the National Research Institute for Mathematics, Netherlands.
Features of Python:
It is an interactive ,interpreted language.
It is a loosely typed object –oriented language.
It is a free open –source and portable language,
It takes less time to develop programs.
It is extensible / extendable and highly efficient .
It supports GUI.
It can be easily compatible with other languages like C , C++
etc.
It is used for both scientific and non-scientific programming.
Installing Python:
It can be installed by using website :
https://www.python.org/downloads/
14
Interacting with Python:
Python programs can be run in two ways:
Using Command line window
Using IDLE
15
For those who use SQL Connectivity
Table Design:
For example BUT PUT ACCORDING TO YOUR PROJECT
16
Table 1: BOOKRECORD
17
Table2: MEMBER
18
Table3: ISSUE
19
TABLE JOIN
20
21
For those who use DFH, Binary file
File:- A file is a collection of related data stored in a particular area on the disk.
22
Python allow us to create and manage following types of
file
Text
Binary
23
Source Code:
24
6.Output
25
7. References
In order to work on this project titled –NAME OF THE ROJECT, 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/
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"))
26
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])
27
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()
28
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])
29
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:
30
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
31
""")
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()
OUTPUT
32
Main Menu
Adding Records
Displaying Records
33
Appending Records
34
35
Searching record by Roll number
Deleting record
37
38