Question: Program 1: The UML below represents the class Course, its attributes, and methods. Write a python program for this UML class. Program 2: Open a

Program 1: The UML below represents the class Course, its attributes, and methods. Write a python program for this UML class. Program 2: Open a new python file named with your student ID and import the class you have created in Exercise 1 and Create 6 instances of Course class with the following information: Instance 1: (Code = IS 324, Capacity =80, Core = True, StudentsNo =78 ) Instance 2: (Code =CS111, Capacity =180, Core = True, StudentsNo =180 ) Instance 3:( Code = IS481, Capacity =50, Core = False, StudentsNo =31) Instance 4:( Code = SE434, Capacity =50, Core = False, StudentsNo =39) Instance 5: (Code = CE443, Capacity =50, Core = False, StudentsNo =24) Instance 6:( Code = CS227, Capacity =180, Core = True, StudentsNo =150 ) Program 3: With the same python file you have created in Exercise 2, create an empty list and add all the previous instances to this list. Program 4: Write the following functions in the same python file you have created in Exercise 2: A) num_Core(self, list): that accepts a list of courses and returns how many course are core. Testing: If I call this method with the list you created in Exercise 3, the output should be 3 as there are 3 courses which are defined as core courses. B) num_IS_Core(self, list): that accepts a list of courses and returns how many IS courses are core. (Hint: you should check the course code) Testing: If I call this method with the list you created in Exercise 3, the output should be 1 as there are only IS324 which is IS and core. C) course_Search(self, list, core, rate): that accepts a list of courses, core (boolean), rate (int), and print out the info for all courses that meets the core condition and has a occupancy rate more than or equal the specified rate. Testing: If I call this method with the list you created in Exercise 3 and core =F alse, rate =70, the output should be: (Code = SE434, Capacity =50, Core = False, StudentsNo = 39)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
