Question: in python,, two problems that are combined. please provide a code i can edit and abel to execute. Implement a class Student . For the
in python,, two problems that are combined. please provide a code i can edit and abel to execute.
Implement a class Student. For the purpose of this exercise, a student has a name and a total quiz score. Supply an appropriate constructor and methods getName(), addQuiz(score), getTotalScore(), and getAverageScore(). To compute the latter, you also need to store the number of quizzes that the student took. Below is the program that runs Student class. 5 pts
# Create a new student.
s = Student("Bob")
# Add some quiz scores.
s.addQuiz(50)
s.addQuiz(90)
s.addQuiz(75)
# Show that the total and the average are computed correctly.
print(s.getName(), "had a total score of %f." % s.getTotalScore())
print("The average score was %.1f." % s.getAverageScore())
Your code with comments
A screenshot of the execution
Modify the Student class of problem #1 to compute grade point averages. Methods are needed to add a grade and get the current GPA. Specify grades as elements of a class Grade. Supply a constructor that constructs a grade from a string, such as B+. You will also need a method that translates grades into their numeric values (for example B+ becomes 3.3). Below is the program that runs the Student and Grade classes. 5 pts
# Create a new student.
s = Student("Bob")
# Add some quiz grades.
s.addQuiz(Grade("D"))
s.addQuiz(Grade("A-"))
s.addQuiz(Grade("B"))
# Show that the total and the average are computed correctly.
print(s.getName(), "had a total of %.1f grade points." % s.getTotalScore())
print("The GPA was %.1f." % s.getAverageScore())
Your code with comments
A screenshot of the execution
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
