Computer Sci Help pls

Write a Class to represent one of the following items. Note that each class must a proper constructor even though the constructor is not explicitly named. 2. Student that has a name, point and course count. The class should have methods that can: (a) add a grade to the GPA and GPA should be calculated and returned appropriately, (b) create duplicate of itself and return that duplicate, and (c) see if another student has the same name and GPA as itself and return True or False appropriately

Answers

class Student: def __init__(self, name, point, course_count): self.name = name self.point = point self.course_count = course_count self.total_points = 0 self.grade_point_average = 0 def add_grade(self, grade): self.total_points += grade * self.course_count self.grade_point_average = self.total_points / self.course_count return self.grade_point_average def clone(self): return Student(self.name, self.point, self.course_count) def compare_name_and_gpa(self, student): if self.name == student.name and self.grade_point_average == student.grade_point_average: return True else: return False

Answered by Ashley Wells

We have mentors from

Contact support