report card Management Project in Python[2]
report card Management Project in Python[2]
report card Management Project in Python[2]
Project Report
On
Submitted By -
NAME :ASHOUXII ‘
STD A’
BOARD ROLL NO. :
ADM. NO. :
SIGNATURE OF SIGNATURE OF
EXTERNAL EXAMINER COMPUTER TEACHER
ACKNOWLEDGEMENT
SYSTEM DESCRIPTION
Categories:-
Entering the Name, roll no and marks of the student in the provided
subjects.
For modifying, deleting and searching for a student record.
Outputs are:-
PROBLEM DESCRIPTION
We have studied the existing system in detail. The finding of our study
yield various pieces of information which are described in the following
manner:-
We can edit the marks of the student easily to generate the report again.
It save the time of the teacher to calculate the percentage and the grade
or rank and pass or fail.
This software reduces paper work.
It is easy to handle student’s record.
This software saves the time.
Information of each student stores permanently.
Disadvantages:-
RAM : 2 GB
Software Specification: -
Description
Function blocks begin with the keyword def followed by the function name and
parentheses ( ( ) ).
Any input parameters or arguments should be placed within these parentheses. You can
also define parameters inside these parentheses.
The first statement of a function can be an optional statement - the documentation string of
the function or docstring.
The code block within every function starts with a colon (:) and is indented.
The statement return [expression] exits a function, optionally passing back an expression
to the caller. A return statement with no arguments is the same as return None
The program is easier to understand. : Main block of program becomes compact as the
code of functions is not the part of it, thus is easier to read and understand.
Redundant code is at one place, so making is easier. : Instead of writing code again
when we need to use it more than once, we can write the code in the form of a function
and call it more than once. If we later need to change the code , we change it in one place
only. Thus it saves our time also.
Reusable function can be put in a library in modules. : We can store the reusable
functions in the form of modules. These modules can be imported and used when needed
in other programs.
MICROSOFT WORD
Microsoft Word was initially launched in 1983, and has since been revised
numerous times. It is available for both Windows and Apple operating systems
Functions Created
Home()- Function to display the project’s main screen i.e. the home page of the
project or you can say the main menu for selecting the desired operation to perform.
Roomservie()- Function for room service which provides user/customer with the
restaurant’s menu card to order food at the room.
Payment()- Function for payment of hotel room and restaurant bill generation at the
time of check-out.
import pickle
import os
import csv
r="Report_card"
def Create():
f=open(r,"wb")
e=int(input("How many entries? "))
for i in range(e):
adm=input("Enter the Admission no.: ")
roll=int(input("Enter the roll number: "))
name=input("Enter the name of the student: ")
cl=int(input("Enter the class: "))
sec=input("Enter the section: ")
phy=float(input("Enter the marks of Physics: "))
chem=float(input("Enter the marks of Chemistry: "))
math=float(input("Enter the marks of Maths: "))
comp=float(input("Enter the marks of computer science:"))
eng= float(input("Enter the marks of english:"))
cas=input("Enter your caste: (Gen/SC/ST/OBC) ")
T=phy+chem+math+comp+eng
per=round(T/500*100)
if round(per)>=33:
rem="PASS"
else:
rem="FAIL"
l=[adm,roll,name,cl,sec,phy,chem,math,comp,eng,T,per,cas,rem]
pickle.dump(l,f)
print("Entries successfully accepted!\n")
f.close()
def Append():
f=open(r,"ab")
e=int(input("How many entries?: "))
for i in range(e):
adm=input("Enter the Admission no.: ")
roll=int(input("Enter the roll number: "))
name=input("Enter the name of the student: ")
cl=int(input("Enter the class: "))
sec=input("Enter the section: ")
phy=float(input("Enter the marks of Physics: "))
chem=float(input("Enter the marks of Chemistry: "))
math=float(input("Enter the marks of Maths: "))
comp=float(input("Enter the marks of Computer Science: "))
eng=float(input("Enter the marks of English: "))
cas=input("Enter your caste: (Gen/SC/ST/OBC) ")
T=phy+chem+math+comp+eng
per=round(T/500*100)
if round(per)>=33:
rem="PASS"
else:
rem="FAIL"
l=[adm,roll,name,cl,sec,phy,chem,math,comp,eng,T,per,cas,rem]
pickle.dump(l,f)
print("Entries successfully added!\n")
f.close()
def Display_Report():
k=0
f=open(r,"rb")
s=input("Enter the section: ")
print("Below displaying the report card of class 12-",s,"\n")
print("Adm no.\tRoll
No.\tName\tClass\tSec\tPhy\tChem\tMaths\tComp\tEng\tTotal\tpercent\tCaste\tRemarks")
try:
while True:
q=pickle.load(f)
if q[4]==s:
k+=1
print(q[0],"\t",q[1],"\t",q[2],"\t",q[3],"\t",q[4],"\t",q[5],"\t",q[6],"\t",q[7],"\t",q[8],
"\t",q[9],"\t",q[10],"\t",q[11],"%\t",q[12],"\t",q[13])
except EOFError:
print("\n")
if k==0:
print("ERROR: Invalid section!\n")
f.close()
def Display_topper():
f=open(r,"rb")
s=input("Enter the section: ")
l=[]
k=0
try:
while True:
q=pickle.load(f)
if q[4]==s:
l.append(q[9])
k+=1
except EOFError:
pass
if k!=0:
t=max(l)
print("\nAdmNo.\tRoll No.\tName(s)\tTotal\tPercent")
f.seek(0)
try:
while True:
q=pickle.load(f)
if q[4]==s and q[9]==t:
print(q[0],"\t",q[1],"\t",q[2],"\t",q[10],"/t",q[11])
except EOFError:
print("\n")
else:
print("ERROR: Invalid section!\n")
f.close()
def Display_avg():
f=open(r,"rb")
s=input("Enter the section: ")
k=0
print("\nAdmNo.\tRoll No.\tName(s)\tAverage")
try:
while True:
q=pickle.load(f)
if q[4]==s:
print(q[0],"\t",q[1],"\t",q[2],"\t",(q[10]//5))
k=k+1
except EOFError:
print("\n")
if k==0:
print("ERROR: Invalid section!\n")
f.close()
def Display_indi():
k=0
f=open(r,"rb")
adm=input("Enter the adm no.: ")
s=input("Enter the section: ")
try:
while True:
q=pickle.load(f)
if q[0]==adm and q[4]==s:
k+=1
print("\n-------------------------------------------")
print("Admission No.| Roll No. :\t",q[0]," | ",q[1])
print("Class :\t",q[3],"-",q[4])
print("Name :\t",q[2],"\tCaste :\t",q[12])
print("\nSubject \tMax marks\tMarks scored")
print("Physics \t100 \t",q[5])
print("Chemistry \t100 \t",q[6])
print("Mathematics \t100 \t",q[7])
print("Computer Sc.\t100 \t",q[8])
print("English \t100 \t",q[9])
print("\nGrand Total :\t",q[10])
print("Percentage :\t",q[11],"%")
print("REMARKS :\t",q[13])
print("-------------------------------------------\n")
except EOFError:
pass
if k==0:
print("ERROR: Invalid adm no. or section!")
f.close()
def Cat_90():
f=open(r,"rb")
c=k=0
s=input("Enter the section: ")
print("Student(s) who scored overall 90% and above:")
print("\nAdmNo.\tRoll No.\tName(s)\tTotal\tPercent")
try:
while True:
q=pickle.load(f)
if q[4]==s:
c+=1
if q[11]>=90:
k+=1
print(q[0],"\t",q[1],"\t",q[2],"\t",q[10],"\t",q[11])
except EOFError:
pass
if k==0 and c!=0:
print("------NO STUDENTS SCORED 90% AND ABOVE-------\n")
if c==0:
print("ERROR: Invalid section!\n")
f.close()
def Cat_caste():
k=0
f=open(r,"rb")
s=input("Enter the section: ")
c=input("Enter the caste to be categorised: (Gen/SC/ST/OBC) ")
print("\nAdmNo.\tRoll No.\tName(s)\tCaste")
try:
while True:
q=pickle.load(f)
if q[4]==s and q[12]==c:
print(q[0],"\t",q[1],"\t",q[2],"\t",q[12])
k+=1
except EOFError:
pass
if k==0:
print("ERROR: Invalid section or caste!\n")
f.close()
def Cat_remPass():
k=c=0
f=open(r,"rb")
s=input("Enter the section: ")
print("\nAdmNo.\tRoll No.\tName(s)\tRemarks")
try:
while True:
q=pickle.load(f)
if q[4]==s:
k+=1
if q[13]=="PASS":
c+=1
print(q[0],"\t",q[1],"\t",q[2],"\t",q[13])
except EOFError:
pass
if k==0:
print("ERROR: Invalid section!")
else:
print("\nNo. of student(s) passed: ",c,"\n")
f.close()
def Cat_remFail():
k=c=0
f=open(r,"rb")
s=input("Enter the section: ")
print("\nAdmNo.\tRoll No.\tName(s)\tRemarks")
try:
while True:
q=pickle.load(f)
if q[4]==s:
k+=1
if q[13]=="FAIL":
c+=1
print(q[0],"\t",q[1],"\t",q[2],"\t",q[13])
except EOFError:
pass
if k==0:
print("ERROR: Invalid section!")
else:
print("\nNo. of student(s) failed: ",c,"\n")
f.close()
def Cat_imp():
k=0
l=[]
f=open(r,"rb")
s=input("Enter the section: ")
print("\nAdmNo.\tRollNo.\t Name\t\tSubjects to be improved")
try:
while True:
q=pickle.load(f)
if q[4]==s:
k+=1
if q[5]<60:
l.append("Phy")
if q[6]<60:
l.append("Chem")
if q[7]<60:
l.append("Maths")
if q[8]<60:
l.append("Comp")
if q[9]<60:
l.append("Eng")
print(q[0]," \t",q[1],"\t",q[2],"\t",l)
l=[]
except EOFError:
pass
if k==0:
print("ERROR: Invalid section!\n")
f.close()
def Search_adm():
k=0
f=open(r,"rb")
st=input("Enter an admission no. to be searched: ")
try:
while True:
q=pickle.load(f)
if q[0]==st:
print("\nRecord found!\n")
print("\t\t\t---Report of adm no.",st,"is shown below--- \n")
print("Adm no.\tRoll No.\tName\tClass\tSec\tPhy\tChem\tMaths\tComp
\tEng\tTotal\tPercent\tCaste\tRemarks")
print(q[0],"\t",q[1],"\t",q[2],"\t",q[3],"\t",q[4],"\t",q[5],"\t",q[6],
"\t",q[7],"\t",q[8],"\t",q[9],"\t",q[10],"\t",q[11],"%\t",q[12],"\t",q[13],"\n")
k+=1
except EOFError:
pass
if k==0:
print("ERROR: Record not found!\n")
f.close()
def Search_name():
k=0
f=open(r,"rb")
st=input("Enter a name to be searched: ")
try:
while True:
q=pickle.load(f)
if q[2].lower()==st.lower():
print("\nRecord found!\n")
print("\t\t\t---Report of",(st.upper()),"is shown below--- \n")
print("Adm no.\tRoll
No.\tName\tClass\tSec\tPhy\tChem\tMaths\tComp\tEng\tTotal\tPercent\tCaste\tRemarks")
print(q[0],"\t",q[1],"\t",q[2],"\t",q[3],"\t",q[4],"\t",q[5],"\t",q[6],
"\t",q[7],"\t",q[8],"\t",q[9],"\t",q[10],"\t",q[11],"%\t",q[12],"\t",q[13],"\n")
k+=1
except EOFError:
pass
if k==0:
print("ERROR: Record not found!\n")
f.close()
def Search_roll():
k=0
f=open(r,"rb")
st=int(input("Enter a roll no. to be searched: "))
try:
while True:
q=pickle.load(f)
if q[1]==st:
print("\nRecord found!\n")
print("\t\t\t---Report of roll no",st,"is shown below--- \n")
print("Adm no.\tRoll No.\tName\tClass\tSec\tPhy\tChem\tMaths\tComp
tEng\tTotal\tPercent\tCaste\tRemarks")
print(q[0],"\t",q[1],"\t",q[2],"\t",q[3],"\t",q[4],"\t",q[5],"\t",q[6],
"\t",q[7],"\t",q[8],"\t",q[9],"\t",q[10],"\t",q[11],"%\t",q[12],"\t",q[13],"\n")
k+=1
except EOFError:
pass
if k==0:
print("ERROR: Record not found!\n")
f.close()
def sort():
k=0
s=input("Enter the section: ")
f1=open("temp.dat","wb")
f=open(r,"rb")
maxx=0
minn=99
l=[]
try:
while True:
q=pickle.load(f)
if q[4]==s:
k+=1
l.append(q)
if q[1]>maxx:
maxx=q[1]
if q[1]<minn:
minn=q[1]
except EOFError:
pass
for j in range(minn,maxx+1):
for i in l:
if i[1]==j:
pickle.dump(i,f1)
f.close()
f1.close()
os.remove(r)
os.rename("temp.dat",r)
if k==0:
print("ERROR: Invalid section!\n")
else:
print("Record(s) successfully sorted!\n")
f.close()
def Update():
k=0
f=open(r,"rb")
f1=open("temp.dat","wb")
s=input("Enter section: ")
st=input("Enter the adm no. of the student for updation: ")
try:
while True:
l=pickle.load(f)
if l[0]==st and l[4]==s:
k+=1
ans=input("\nDo You want to update name? (Y/N): ")
if ans.upper()=='Y':
print("Current Name: ",l[2])
nam=input("Enter the updated name: ")
l[2]=nam
ans=input("Do You want to update class? (Y/N): ")
if ans.upper()=='Y':
print("Current Class: ",l[3])
c=input("Enter the updated class: ")
l[3]=c
ans=input("Do You want to update section? (Y/N): ")
if ans.upper()=='Y':
print("Current section: ",l[4])
s=input("Enter the updated section: ")
l[4]=s
ans=input("Do You want to update marks of physics? (Y/N): ")
if ans.upper()=='Y':
print("Current physics marks: ",l[5])
p=float(input("Enter the updated physics marks: "))
l[5]=p
ans=input("Do You want to update marks of chemistry? (Y/N): ")
if ans.upper()=='Y':
print("Current chemistry marks: ",l[6])
q=float(input("Enter the updated chemistry marks: "))
l[6]=q
ans=input("Do You want to update marks of maths? (Y/N): ")
if ans.upper()=='Y':
print("Current maths marks: ",l[7])
m=float(input("Enter the updated maths marks: "))
l[7]=m
ans=input("Do You want to update marks of computer science? (Y/N): ")
if ans.upper()=='Y':
print("Current computer science marks: ",l[8])
g=float(input("Enter the updated computer science marks: "))
l[8]=g
ans=input("Do You want to update marks of english? (Y/N): ")
if ans.upper()=='Y':
print("Current english marks: ",l[9])
h=float(input("Enter the updated english marks: "))
l[9]=h
if ans.upper()=='Y':
print("Current Caste: ",l[12])
h=input("Enter the updated caste: ")
l[12]=l
T=l[5]+l[6]+l[7]+l[8]+l[9]
l[10]=T
l[11]=round(T/500*100)
pickle.dump(l,f1)
except EOFError:
pass
f.close()
f1.close()
if k==0:
print("ERROR: Invalid section or adm no.!\n")
else:
os.remove(r)
os.rename("temp.dat",r)
print("Record successfully updated!\n")
def Delete():
k=0
f=open(r,"rb")
f1=open("temp.dat","wb")
i=input("Enter the adm no. for deletion: ")
try:
while True:
q=pickle.load(f)
if q[0]==i:
k+=1
if q[0]!=i:
pickle.dump(q,f1)
except EOFError:
pass
f.close()
f1.close()
if k==0:
print("ERROR: Invalid adm no.!\n")
else:
os.remove(r)
os.rename("temp.dat",r)
print("Record successfully deleted!\n")
def CSV():
f=open("Report_card.csv","w",newline='')
f1=open(r,"rb")
head=["Adm no.","Roll
No.","Name","Class","Sec","Phy","Chem","Maths","Comp","Eng","Total","Percent","Caste","Remarks"]
q=csv.writer(f,delimiter=",")
q.writerow(head)
try:
while True:
p=pickle.load(f1)
q.writerow(p)
except EOFError:
pass
print("Data successfully copied to excel sheet!")
print("Excel Sheet file name: Report_card")
while True:
print("\t\t\t\t\t\t------ MAIN MENU ------")
print("\t\t\t\t\t\t1. Create report card")
print("\t\t\t\t\t\t2. Add more students")
print("\t\t\t\t\t\t3. Display Method")
print("\t\t\t\t\t\t4. By-Category Method")
print("\t\t\t\t\t\t5. Search Method")
print("\t\t\t\t\t\t6. Update records")
print("\t\t\t\t\t\t7. Delete records")
print("\t\t\t\t\t\t8. Copy to Excel Sheet")
print("\t\t\t\t\t\t9. Sort report card")
print("\t\t\t\t\t\t10. EXIT\n\t\t\t\t\t\t-----------------------")
ch=int(input("Enter your choice: "))
if ch==1:
Create()
elif ch==2:
Append()
elif ch==3:
while True:
print("\t\t\t\t\t\t------ DISPLAY METHOD ------")
print("\t\t\t\t\t\t1. Display Class Report Card")
print("\t\t\t\t\t\t2. Display individual Report Card")
print("\t\t\t\t\t\t3. Display Class Topper(s)")
print("\t\t\t\t\t\t4. Display Average")
print("\t\t\t\t\t\t5. Back to main menu\n\t\t\t\t\t\t-----------------")
ch1=int(input("Enter choice: "))
if ch1==1:
Display_Report()
elif ch1==2:
Display_indi()
elif ch1==3:
Display_topper()
elif ch1==4:
Display_avg()
elif ch1==5:
break
else:
print("Invalid choice!")
elif ch==4:
while True:
print("\t\t\t\t\t\t------ BY-CATEGORY METHOD ------")
print("\t\t\t\t\t\t1. Scored 90% and above")
print("\t\t\t\t\t\t2. By Caste")
print("\t\t\t\t\t\t3. Students passed")
print("\t\t\t\t\t\t4. Students failed")
print("\t\t\t\t\t\t5. Need of Improvement Report")
print("\t\t\t\t\t\t6. Back to main menu\n\t\t\t\t\t\t-----------------")
ch2=int(input("Enter your choice: "))
if ch2==1:
Cat_90()
elif ch2==2:
Cat_caste()
elif ch2==3:
Cat_remPass()
elif ch2==4:
Cat_remFail()
elif ch2==5:
Cat_imp()
elif ch2==6:
break
else:
print("Invalid choice!")
elif ch==5:
while True:
print("\t\t\t\t\t\t------ SEARCH METHOD ------")
print("\t\t\t\t\t\t1. Search by name")
print("\t\t\t\t\t\t2. Search by admission no.")
print("\t\t\t\t\t\t3. Search by roll no.")
print("\t\t\t\t\t\t4. Back to main menu\n\t\t\t\t\t\t-----------------")
ch3=int(input("Enter choice: "))
if ch3==1:
Search_name()
elif ch3==2:
Search_adm()
elif ch3==3:
Search_roll()
elif ch3==4:
break
else:
print("Invalid choice!")
elif ch==6:
Update()
elif ch==7:
Delete()
elif ch==8:
CSV()
elif ch==9:
sort()
elif ch==10:
print("\t\t\t\t\t --Thank You for using our system--")
break
else:
print("invalid choice!")
CONCLUSION