Question 3: Design CSEStudent class and BBAStudent class which inherit from Student class so that the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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}\nDepartment: {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+ 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}\nDepartment: {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+
Expert Answer:
Answer rating: 100% (QA)
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 ... View the full answer
Related Book For
Probability & Statistics for Engineers & Scientists
ISBN: 978-0130415295
7th Edition
Authors: Ronald E. Walpole, Raymond H. Myers, Sharon L. Myers, Keying
Posted Date:
Students also viewed these accounting questions
-
Determine the constant c so that the following function is a probability mass function: for f(x) = cx for x = 1, 2, 3, 4.
-
Determine the values of c so that the following functions represent joint probability distributions of the random variables A" and Y: (a) f(x, y) cxy, for x = 1, 2, 3; y = 1, 2, 3; (b) f(x, y) = c\x...
-
11.5.36 Determine all functions f (x) so that the following differential equation after multiplying by f (y) becomes total: t +y = - (2xy+xy + 2 + " +
-
Aneko Company reports the following ($000s): net sales of $14,800 for 2018 and $13,990 for 2017; end-of-year total assets of $19,100 for 2018 and $17,900 for 2017. Compute its total asset turnover...
-
What is an intangible asset? What is amortization?
-
If the resultant force of the two tugboats is 3 kN. directed along the positive x axis, determine the required magnitude of force FB and its direction O. F = 2 kN 30 FB O B -X
-
The Wide World of Fluids article titled "Bow Thrusters,".The bow thruster on the boat shown in Fig. P5.77 is used to turn the boat. The thruster produces a \(1-\mathrm{m}\)-diameter jet of water with...
-
Healthwin-Midtown Convalescent Hospital, Inc. (Healthwin), was incorporated in California for the purpose of operating a health-care facility. For three years thereafter, it participated as a...
-
A ray of light is traveling from water (n = 1.33) into an unknown substance. The angle of incidence at the boundary is 35 degrees and the refracted angle is 52 degrees. A) Calculate the index of...
-
Pavement Corp. ("Pavernent) nas been operating sinoe 1398. Ht is now Docember 31, 2004, and Pavement is about to prepare consolidated finendial etetements for Favement and ts subeidiary. Sigur. Co...
-
People prefer to wear clothes during winter ? Options: 1) Wool 2) Silk 3) Cotton 4) Nylon
-
What are the four main aspects of a Balanced Scorecard?
-
What is required of the management accountant in carrying out performance evaluation?
-
What are the three basic questions to be asked in relation to report preparation?
-
Give three possible causes of a favourable direct materials usage variance.
-
Give two examples of quantitative non-financial performance measures.
-
Share your opinion regarding how Google and its various products have become engines of social and cultural change in India.
-
Rowland Textile Inc. manufactures two products: sweatshirts and T-shirts. The manufacturing process involves two activities: cutting and sewing. Expected overhead costs and cost drivers are as...
-
The following measurements were recorded for the drying time, in hours, of a certain brand of latex paint. 3.4 2.5 4.8 2.9 3.6 2.8 3.3 5.6 3.7 2.8 4.4 4.0 5.2 3.0 4.8 Assume that the measurements are...
-
A stream of protons, each with a speed of 0.9900c is directed into a two-slit experiment where the slit separation is 4.00 x 10-9 m. A two-slit interference pattern is built up on the viewing screen....
-
A truth serum has the property that 90% of the guilty suspects are properly judged while, of course, 10% of guilty suspects are improperly found innocent. On the other hand, innocent suspects are...
-
(a) Consider a single elementary magnet inside a closed surface. Given that elementary magnets are particles without spatial extent, is the magnetic field line flux through the closed surface...
-
What is the direction of the magnetic field lines inside the bar magnet of Figure 27.13? Figure 27.13 Magnetic field line pattern surrounding a bar magnet. N S
-
Can you replace the current-carrying rod of Figure 27.16 by a magnet and get the same magnetic field? Figure 27.16 A flow of charge carriers through a conducting rod causes a circular alignment of...
Study smarter with the SolutionInn App