Create a Python Class calledPassengerDoor. The attributes must includelock status – locked or unlockeddoor - open or closedchild safety – engaged or...







Create a Python Class calledPassengerDoor. The attributes must include

















    1. lock status – locked or unlocked








    2. door - open or closed








    3. child safety – engaged or disengaged








    4. gear status – values can be P, D, R (Hint: You only need to handle the case where its’s set to P in your solution)





























The following rules apply to the car door:












  • The door can be opened only if











    • unlocked








    • closed,








    • the gear is set to P








    • child safety disengaged.














  • The child-safety mechanism can only be engaged or disengaged while the door is open and unlocked.








  • The door cannot be locked, and the gear cannot be set to any other value








    • if the child safety is disengaged














  • The gear can be changed to any other value at any other time








  • The door can be opened or closed at any other time




















Your class must include accessors and mutators and other helper methods.








You must also include the ability toprint the current statusof the PassengerDoor.








All attributes must be private.

















You must test this by creating a tester file. You only have to submit the source file for the class.



































File to be submitted: PassengerDoor.py










Apr 03, 2023
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here