Question: In Python: Write a class named Course that has the following attributes: __name (the name of the course) __CRN (registration ID as in BearWeb) __seats

In Python: Write a class named Course that has the following attributes: __name (the name of the course) __CRN (registration ID as in BearWeb) __seats (the number of seats currently available) __status (open or closed) The Course class should have an __init__ method that creates these attributes. In addition it should have a method to return each attribute (get_name, get_CRN, get_seats and get_status) The class should also have a method called Update_Seat_Count that will update the seats attribute (decrease by 1) every time it is called. Once the seats attribute hits zero, the status attribute should be changed to 'closed' Write a program that will create an object based on the Course Class with these details: Name - MIS 4V98 - Introduction to Python CRN - 250309 seats - 5 status - open create a register function that will call the Update_Seat_Count method. If there are no seats available, the function should not update the seats attribute and display a message with the current status of the Course. Otherwise it should display the details of the course as displayed below by calling the appropriate method: Name: MIS 4V98 - Introduction to Python CRN: 250309 Seats: {current count} status: {open or closed depending on seats} In your program, call the register function 6 times, so that it should show the deceasing number of seats and finally that the class is closed (on the 6th time).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!