Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Python: Suppose class Student represents information about students in a course. Each student has a name and a list of test scores. The Student

Using Python:

image text in transcribed

Suppose class Student represents information about students in a course. Each student has a name and a list of test scores. The Student class should allow the user to view a student's name, view a test score at a given position, view the highest test score, view the average test score, and obtain a string representation of the student's information. When a Student object is created, the user supplies the student's name and the number of test scores. Each score is initially presumed to be 0. Complete the missing codes in the following program. class Student (object): """Represents a student.""" def init (self, name, number) ""All scores are initially 0." self. name name self-scores [] for count in xrange (number) self. scores.append (O) def getName (self): """Returns the student's name.""" #your code here def setScore (self, i, score): """Resets the ith score, counting from 1.""" #your code here def getScore (self,i ""Returns the ith score,counting from 1.""" #your code here def getAverage (self): ""Returns the average score.""" #your code here def getHighScore (self) ""Returns the highest score.""" #your code here def st (self) ""Returns the string representation of the student.""" #your code here

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

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions