Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You only need to complete the sections that are indicated in the code. Output should be: The output of the program should look as follows:
You only need to complete the sections that are indicated in the code.
Output should be:
The output of the program should look as follows:
Name: Juan
Score :
Score :
Score :
High Score:
Average:
Name: Bill
Score :
Score :
Score :
High Score:
Average:
Name: Stacy
Score :
Score :
Score :
High Score:
Average:
Name: Maria
Score :
Score :
Score :
High Score:
Average:
Name: Charley
Score :
Score :
Score :
High Score:
Average:
Fill in missing code:
class Student:
def initself n nScores:
self.name n
self.scores
self.nScores nScores
for idx in rangenScores:
self.scores.append
def setScoreself idx, grade:
self.scoresidx grade
#create a function named getNumberOfScores that returns the current number of scores
#create a function named getName that returns the name of the student
#create a function named getHighScore that loops through all scores, determines highest and returns it
#create a function named getAverage that sums all the scores, divides them by the number of scores, and returns the result
def mainnumScores :
from random import randint
Tests sorting."""
# Create the list and put students into it
students list
names Juan "Bill", "Stacy", "Maria", "Charley"
for name in names:
s Studentname numScores
for index in rangenumScores:
ssetScoreindex randint
students.appends
# Print the contents
for s in students:
print Name: s sgetName
for score in rangenumScores:
print Score score: sscoresscore
print High Score: sgetHighScore
print Average: f
sgetAverage
if namemain:
main
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started