Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. Implement a class Student . For the purpose of this exercise, a student has a name and a total quiz score. Supply an appropriate

4. 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())

a) Your code with comments

b) A screenshot of the execution

use Pythone to run this and please follow the Q step by step and make sure to include the comments with the coding

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions