Question: 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:

Using Python: Suppose class Student represents information about students in a course.

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!