Question: URGENT!! Python Question Q5 There are four parts to this question. You will need to use the patient class and the Ward class that are

URGENT!! Python Question

URGENT!! Python Question Q5 There are four parts to this question. You

will need to use the patient class and the Ward class that

are defined in the template. Q5a Write a class that fulfils the

following specifications. Class name BClassWard There is no parameter for this class

constructor. Parameter(s) argument(s) for the constructor init Detailed description This class inherits

the Ward class given in the template. Class attributes Override the class

Q5 There are four parts to this question. You will need to use the patient class and the Ward class that are defined in the template. Q5a Write a class that fulfils the following specifications. Class name BClassWard There is no parameter for this class constructor. Parameter(s) argument(s) for the constructor init Detailed description This class inherits the Ward class given in the template. Class attributes Override the class attributes as followed: The maximum occupancy of a B class ward is 6. its daily rate is 100 dollars instead of 35 dollars. Example usage ward - BClassward() print(BClassWard. MAXIMUM_OCCUPANCY) print(BClassWard.DAILY_RATE) ward.check_in("Jane Doe") ward.increment_length_of_stay() ward.check_in("John Doe") ward.increment_length_of_stay() for patient in ward.patients: print(patient.name) print(ward.get_patient_cost(patient.name)) Example usage 6 output 100 Jane Doe 200 John Doe 100 Q5b. Write a class that fulfils the following specifications. Class name AClassward There is no parameter for this class constructor. Parameter(s) argument(s) for the constructor init Detailed description This class inherits the Ward class given in the template. Class attributes 1. Override the class attributes as followed: The MAXIMUM_OCCUPANCY of an AClassWard is 1. Its DAILY_RATE IS 500 dollars instead of 35 dollars. 2. Define an additional class attribute: SLEEPER_UNIT PRICE: float The default value for the SLEEPER_UNIT_PRICE IS 100 dollars. Instance attribute The class has an additional instance attribute: 1. has_sleeper_unit: bool The default value for this attribute is False. Example usage ward = AClassward() print(AClassward. MAXIMUM_OCCUPANCY) print(AClassward.DAILY_RATE) print(ward.has_sleeper_unit) Example usage 1 output 500 False Q5c. Override the instance method check in for the Aclassward class as follows. Method name check_in Parameter(s) 1. patient_name: str argument(s) 2. needs_sleep_unit: bool The second parameter, needs_sleep_unit, is an optional parameter and its default value is False. Return value This method does not have a return value Detailed Call the method of same name in the parent's class with patient_name description as the parameter. Use the parameter needs_sleep_unit to set the value of the instance attribute has_sleeper_unit. Example usage ward201a = Aclassward() ward201a.check_in("Tom Harris", False) ward201b - AClassWard() ward2016.check_in("Cassandra Green", True) print(ward2012.patients[0].name) print(ward2017.has_sleeper_unit) print(ward2016.patients[0].name) print(ward201b.has_sleeper_unit) Example usage output Tom Harris False Cassandra Green True Q5b. Write a class that fulfils the following specifications. Class name AClassward There is no parameter for this class constructor. Parameter(s) argument(s) for the constructor init Detailed description This class inherits the Ward class given in the template. Class attributes 1. Override the class attributes as followed: The MAXIMUM_OCCUPANCY of an AClassWard is 1. Its DAILY_RATE IS 500 dollars instead of 35 dollars. 2. Define an additional class attribute: SLEEPER_UNIT PRICE: float The default value for the SLEEPER_UNIT_PRICE IS 100 dollars. Instance attribute The class has an additional instance attribute: 1. has_sleeper_unit: bool The default value for this attribute is False. Example usage ward = AClassward() print(AClassward. MAXIMUM_OCCUPANCY) print(AClassward.DAILY_RATE) print(ward.has_sleeper_unit) Example usage 1 output 500 False Q5d. Override the instance method get_patient_cost for the Aclassward class Method name get_patient_cost Parameter(s) argument(s) 1. patient_name: str Return value 1. a float Detailed description Example usage Get the basic cost using the get_patient_cost method from the parent class with the necessary parameters. Return the sum of the basic cost and the product of the SLEEPER_UNIT_RATE and the instance's length of stay if the instance attribute has_sleeper_unit is True. Otherwise, return the basic cost. ward201a = AClassward() ward201a.check_in("Tom Harris", False) ward2016 AClassWard() ward2016.check_in("Cassandra Green", True) ward201a.increment_length_of_stay() ward201b.increment_length_of_stay() print(ward2012.get_patient_cost("Tom Harris")) print(ward2016.get_patient_cost("Cassandra Green")) = Example usage output 500 600 Q5d. Override the instance method get_patient_cost for the Aclassward class Method name get_patient_cost Parameter(s) argument(s) 1. patient_name: str Return value 1. a float Detailed description Example usage Get the basic cost using the get_patient_cost method from the parent class with the necessary parameters. Return the sum of the basic cost and the product of the SLEEPER_UNIT_RATE and the instance's length of stay if the instance attribute has_sleeper_unit is True. Otherwise, return the basic cost. ward201a = AClassward() ward201a.check_in("Tom Harris", False) ward2016 AClassWard() ward2016.check_in("Cassandra Green", True) ward201a.increment_length_of_stay() ward201b.increment_length_of_stay() print(ward2012.get_patient_cost("Tom Harris")) print(ward2016.get_patient_cost("Cassandra Green")) = Example usage output 500 600

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!