Please check the file for the details

1 answer below »
Answered Same DayMay 11, 2020

Answer To: Please check the file for the details

Snehil answered on May 14 2020
148 Votes
#class to hold information of a student in one place
class Student:
#variables to hold values total values of all student
totalDfMarks = 0
totalProjectMarks = 0
tota
lFinalExamMarks = 0
totalOverallMarks = 0

#initializes the values of a student when an object is created
def __init__(self,name,dfMarks,projectMarks,finalExamMarks):
#setting values of given student
self.name = name
self.dfMarks = dfMarks
self.projectMarks = projectMarks
self.finalExamMarks = finalExamMarks
self.overallMarks = finalExamMarks + projectMarks + dfMarks

#adding values of given student to total
Student.totalDfMarks += self.dfMarks
Student.totalProjectMarks += self.projectMarks
Student.totalFinalExamMarks += self.finalExamMarks
Student.totalOverallMarks += self.overallMarks
#method to display the menu to user and calling requested functions
def menu():
students = [] #List to hold all students

while True:#loop runs infinitely till user exits by entering 3
print("Enter 1 to add student marks, 2 to display student mark reports, 3 to Exit.")
option = input()
if option == "1":
addStudent(students)
elif option == "2":
showReportMenu(students)
elif option == "3":
print("Bye.")
break

#method to create a student byt user inputted values and appending it to the list
def addStudent(students):
while True:
print("Enter full name of student whose marks need to be entered")
name = input()
dfMarks = getValidMarks("df report", 0., 20.)
projectMarks = getValidMarks("project", 0., 30.)
finalExamMarks = getValidMarks("final exam", 0., 50.)

...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here