Question: python 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

python

python 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

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(ward201a.patients[0].name) print(ward201a.has_sleeper_unit) print(ward2016.patients[0].name) print(ward201b.has_sleeper_unit) Example usage output Tom Harris False Cassandra Green True Q5d. Override the instance method get_patient_cost for the ClassWard 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) ward201b = AClassWard() ward2016.check_in("Cassandra Green", True) ward201a.increment_length_of_stay() ward2016.increment_length_of_stay() print(ward201a.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!