Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions

Question

600 lb 20 0.5 ft 30 30 5 ft

Answered: 1 week ago