I am having a hard time with a question from this week's assignment. I am supposed to write pseudo-code for an everyday task, which I will write below:
Design
Main Module
Call Open Door Module
Call Ignition Module
Call Reverse Module
Call Pull Out Module
End Main Module
Open Door Module
Has Key Been Entered Into Key Slot
If Yes Then Unlock Car Door
If No Remain Locked
Has Door Handle Opened
If Yes Then Open Door
If No Than Keep Door Closed
Close Open Door Module
Ignition Module
Has Key Been Entered Into Ignition
If Yes Then Start Car
If No Keep Car Engine Off
Close Ignition Module
Reverse Module
Has Driver Engaged Seatbelt
If Yes Then Proceed
If No Then Engage Seatbelt Signal
Has Driver Checked Mirrors
If Yes Then Proceed To Reversing
If No Then Remain In Park
End Reverse Module
Pull Out Module
Is Street Clear
If Yes Then Proceed To Pull Out
If No Then Wait For Street to Clear
End Pull out Module
Below, is the question:
• Identify how you can encapsulate the data and processes you identified into an object-oriented design.
I don't know what they mean by encapsulating the data from the driving the car code into an object oriented design. How would I go about this?
Thanks for any help!