Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello! I need help with the following python code. Thanks! Exercise #4 Create a class called Elevator that represents an elevator .Store the following state

Hello! I need help with the following python code. Thanks! image text in transcribed
Exercise #4 Create a class called Elevator that represents an elevator .Store the following state as attributes: floor-the current floor the elevator is on (integer) num_pass-the number of passengers currently in the elevator (integer) ' dooropen True door is open, False-door is closed Have the following methods: .init0-start on floor 1, no passengers, door closed ' get floor, get_num_pass, get door-return these values call_to floor(newfloor)- close the door and move to the new floor " enter_pass(num)-open door, add num passengers - exit_ pass(num)- open door, subtract num passengers -str_-print the current state of the elevator in a readable form Turn in code to Sakai Assignments by 5pm, Sunday, March 4. .Both partners need to submit a copy of your solution. .Please note that no late exercises will be accepted. Your lowest exercise grade will be dropped. Exercise #4 example output Elevator ) floor-1, numpass-0, door floor= 9, numpass-o, door floor=9, numpass-3, door floor-4, numpass-3, door floor-4, numpass-2, door False = False = True False = True print (e) e.call_to floor (9) print (e) e.enter_pass (3) print (e) e.call to floor (4) print (e) e.exit_pass (1) print (e)

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

Advances In Spatial Databases 2nd Symposium Ssd 91 Zurich Switzerland August 1991 Proceedings Lncs 525

Authors: Oliver Gunther ,Hans-Jorg Schek

1st Edition

3540544143, 978-3540544142

More Books

Students also viewed these Databases questions

Question

What is the basic principle underlying activity-based costing?

Answered: 1 week ago