Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 3: Design CSEStudent class and BBAStudent class which inherit from Student class so that the following code provides the expected output. [Assume, per
Question 3: Design CSEStudent class and BBAStudent class which inherit from Student class so that the following code provides the expected output. [Assume, per course tuition fee is 19800. The addCourses() method in both child classes should work for any number of parameters and any type of courses ] class Student: def_init_(self, name, department): self.name = name self.department = department def_str_(self): s = f"Name: {self.name} Department: {self.department}" return s # Write your codes here. # Do not change the following lines of code. s1 = CSEStudent ("Bob", "CSE", 21101018) s1.addCourses ("CSE111","CSE230 ","CSE260","MAT120","CSE320") print('= ======') s1.showPaymentDetails() print('= print(s1) print('= s2 = BBAStudent ("Carol", "BBA", 21104007) s2.addCourses ("BUS101", "MKT201", "MGT423", "BUS201") print('= s2.showPaymentDetails() print('== print (s2) OUTPUT: Bob, your tuition fee is 99000 Name: Bob Department: CSE ID: 21101018 Course Details: 100 Level: ['CSE111', 'MAT120'] 200 Level: ['CSE230', 'CSE260'] 300 Level: ['CSE320'] Carol, your tuition fee is 79200 Name: Carol Department: BBA ID: 21104007 Course Details: 100 Level: ['BUS101'] 200 Level: ['MKT201', 'BUS201] 400 Level: ['MGT423'] 99+
Step by Step Solution
There are 3 Steps involved in it
Step: 1
To solve this problem we need to create two subclasses called CSEStudent and BBAStudent that inherit from the Student class In addition we need to override the addCourses method to sort and store the ...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