Question
A minivan has two sliding doors. Each door can be opened by either a dashboard switch, its inside handle, or its outside handle. However, the
A minivan has two sliding doors. Each door can be opened by either a dashboard switch, its inside handle, or its outside handle. However, the inside handles do not work if a child lock switch is activated. In order for the sliding doors to open, the gear shift must be in park and the mast unlock switch must be activated. Your task is to simulate a portion of the control software for the vehicle. The input is a sequence of values for the switches and the gear shift, in the following order: Dashboard switches for the left and right sliding door, child lock, and master unlock (0 for off or 1 for activated) Inside and outside handles on the left and right sliding doors (0 for closed 1 for open) The gear shift setting (one of P R N D 1 2 3) A typical input would be 0 0 0 1 0 1 0 0 P The input values should be hard coded in a separate class main method to test the different combinations of positions the switches can be in. Print left door opens and/or right door opens as appropriate. If neither door opens, print both doors stay closed.
This should be in java. Thanks!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started