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 master unlock switch must be activated. (This book’s author is the long-suffering owner of just such a vehicle.) 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 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 or 1)
• The gear shift setting (one of P N D 1 2 3 R).

A typical input would be 0 0 0 1 0 1 0 0 P. Print “left door opens” and/or “right door opens” as appropriate. If neither door opens, print “both doors stay closed”.

Step by Step Solution

3.44 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The ythn rgrm is s fllws def drens s is the sequene f vlues String ll the instrutins int the resetiv... View full answer

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

Document Format (2 attachments)

PDF file Icon

2106_61d6ac3462f9f_872223.pdf

180 KBs PDF File

Word file Icon

2106_61d6ac3462f9f_872223.docx

120 KBs Word File

Students Have Also Explored These Related Java Concepts Late Objects Questions!