Question
: Design MSc_Student class and MEng_Student class which inherit Graduate_Student class so that the following code provides the expected output. class Graduate_Student: number_of_graduate_students = 0
: Design MSc_Student class and MEng_Student class which inherit Graduate_Student class so that the following code provides the expected output. class Graduate_Student: number_of_graduate_students = 0 def __init__(self, name, credits): self.name = name self.credits = credits def __str__(self): s = "Department: "+self.name+", Course Credits: "+str(self.credits) return s # Write your codes here. # Do not change the following lines of code. p1 = MSc_Student("CSE", 18) print("=================================") p1.add_MSc_Student("Daniel", 12, "Catherine", 18, "Michael", 15) print("=================================") print(p1) print("=================================") p2 = MEng_Student("CSE", 30) print("=================================") p2.add_MEng_Student("Barry", 12, "Sam", 18) print("=================================") print(p2) print("=================================") print("Total GraduateStudent: ", Graduate_Student.number_of_graduate_students) OUTPUT: MSc Students in CSE have to complete 18 hours for courses. ================================= ================================= Department: CSE, Course Credits: 18 Total Student(s): 3 Student details: Name: Daniel, Course Credits remaining: 6 Name: Catherine, Course Credits remaining: 0 Name: Michael, Course Credits remaining: 3 ================================= MEng Students in CSE have to complete 30 hours for courses. ================================= ================================= Department: CSE, Course Credits: 30 Total Student(s): 2 Student details: Name: Barry, Course Credits remaining: 18 Name: Sam, Course Credits remaining: 12 ================================= Total GraduateStudent: 5
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