LINK (fork this): EDITOR A teacher wants to keep track of students’ grades in a class as well as have the ability to compute some statistics. Write the class GradeReport to help the teacher with this task. The GradeReport class should have the following specifications: def __init__(self, maxSize: int) – Initializes a GradeReport object with TWO instance attributes: maxSize (the maximum number of grades the GradeReport can hold) and grades (a list to hold students’ grades). The grades attribute should be an empty list upon object creation. def add_grade(self, grade: float) – Adds a new grade to the list of student grades. If adding this grade causes len(grades) > maxSize to be true, the OLDEST grade should be removed. def printGradeReport(self) – PRINTS all the current grades according to the following format. If there are no grades in the list, it should follow the same format. “Number of grades in GradeReport: {}” “Maximum number of grades in GradeReport: {}” “Current grades:” {grade1} {grade2} { … } def average_grade(self) – RETURNS the average of all the grades in the list. If there are no grades in the list, it should return -1. def lowest_grade(self) – RETURNS the LOWEST grade in the list. If there are no grades in the list, it should return -1. def highest_grade(self) – RETURNS the HIGHEST grade in the list. If there are no grades in the list, it should return -1. def count_above_average(self) – RETURNS the number of grades that are GREATER THAN the average grade. You should test your code based on the expected behavior. We will not provide any explicit tests.
Blog
What is the primary difference between the git push and git…
What is the primary difference between the git push and git commit commands?
The following Book class contains a constructor that include…
The following Book class contains a constructor that includes attributes title, author, and isbn, as well as a display_info method that prints out the information in the format “Title: {title}, Author: {author}, ISBN: {isbn}”. The eBook class inherits from the Book class but includes the additional attribute format, and also has a display_info method that displays all of the information from Book as well as the format attribute. Identify and correct the errors in the code snippet so the code works as intended based on the expected output below. You cannot change entire chunks of code nor rewrite it again. Mention the line number where the error is, what the error is, and the correction. 1. class Book:2. def __init__(self, title, author, isbn):3. self.title = title4. self.author = author5. self.isbn = isbn6. def display_info(self)7. print(f”Title: {self.title}, Author: {self.author}, ISBN: {self.isbn}”)8. 9. def eBook(Book):10. def __init__(title, author, isbn, format):11. super.__init__(title, author, isbn)12. self.format = format13. 14. def display_info(self):15. super().display_info16. print(f”Format: {self.format}”)
A company manufactures small canoes that has a fixed cost of…
A company manufactures small canoes that has a fixed cost of $14,000. It costs $20 to produce each canoe. The selling price is $40 per canoe. What is the break-even point?
Write a formula for the general term (the nth term) of the g…
Write a formula for the general term (the nth term) of the geometric sequence.2, 4, 8, 16, 32, . . .
Write the first four terms of the sequence whose general ter…
Write the first four terms of the sequence whose general term is given.an = 3(2n – 1)
Write the first four terms of the sequence defined by the re…
Write the first four terms of the sequence defined by the recursion formula.a1 = 5 and an = an-1 – 1 for n ≥ 2
Write the sum using summation notation.-6 + 36 – 216 + 1296
Write the sum using summation notation.-6 + 36 – 216 + 1296
En descendant, son ami et lui [1] dans un ravin et ils [2].
En descendant, son ami et lui [1] dans un ravin et ils [2].
C. Choisissez Choose the correct direct object pronoun to r…
C. Choisissez Choose the correct direct object pronoun to replace the direct object in each sentence. (5 x 1 pt. each = 5 pts.)