Question: 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!  Hello! I need help with the following python code. Thanks! Exercise

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

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!