C#
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.
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”.
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
- Programming logic and designarrow_forwardA boolean expression is an expression that only evaluates to true or false.arrow_forwardSet up a password variable in your C# application and assign a password to this variable. Run your program and type in invalid passwords to check and see if your boolean logic is correct. Once the correct password is typed, the program should stop asking for input. You should do this by utilizing a while loop or a do while loop. Sample output is below: Enter the password :: hello INVALID Enter the password :: hacker INVALID Enter the password :: i INVALID Enter the password :: am INVALID Enter the password :: a INVALID Enter the password :: hacker INVALID Enter the password :: taylor INVALID Enter the password :: go INVALID Enter the password :: swift INVALID Enter the password :: taylorswift INVALID Enter the password :: taylorswiftchiefs INVALID Enter the password :: taylorswiftgoingtothesuperbowl VALIDarrow_forward
- Python codingarrow_forwardPLZ helpw the following IN JAVA A button fires events know as: static events passive events dynamic events action eventsarrow_forwardDesign an algorithm that will read two numbers and an integer code from thescreen. The value of the integer code should be 1, 2, 3 or 4. If the value of thecode is 1, compute the sum of the two numbers. If the code is 2, compute thedifference (first minus second). If the code is 3, compute the product of the twonumbers. If the code is 4, and the second number is not zero, compute thequotient (first divided by second). If the code is not equal to 1, 2, 3 or 4, displayan error message. The program is then to display the two numbers, the integercode and the computed result to the screen.arrow_forward
- Draw a structured flowchart or write pseudocode that describes the process of guessing a number between 1 and 1oo. After each guess, the player is told that the guess is too high or too low. The process continues until the player guesses the correct number. Pick a number and have a fellow student try to guess it by following your instructions.arrow_forwardC Programmingarrow_forwardflowchart in visual basicarrow_forward
- 6. Draw a structured flowchart or write pseudocode that describes the process of guessing a number between 1 and 100. After each guess, the player is told that the guess is too high or to0 low. The process continues until the player guesses the correct number. Pick a number and have a fellow student try to guess it by following your instructions.arrow_forwardthis is the code: const int BLED=9; //Blue LED on Pin 9const int GLED=10; //Green LED on Pin 10const int RLED=11; //Red LED on Pin 11const int Switch=2; //The Button is connected to pin 2boolean lastSwitch = LOW; //Last Button Stateboolean currentSwitch = LOW; //Current Button Stateint ledMode = 0; //Cycle between LED statesboolean ledOn = false;void setup(){ pinMode (BLED, OUTPUT); //Set Blue LED as OutputpinMode (GLED, OUTPUT); //Set Green LED as OutputpinMode (RLED, OUTPUT); //Set Red LED as OutputpinMode (Switch, INPUT); //Set button as input (not required)}}/** LED Mode Selection Pass a number for the LED state and set it accordingly.*/void setMode(int mode){//RED if (mode == 1) { digitalWrite(RLED, HIGH); digitalWrite(GLED, LOW); digitalWrite(BLED, LOW);} //GREENelse if (mode == 2){ digitalWrite(RLED, LOW); digitalWrite(GLED, HIGH); digitalWrite(BLED, LOW); }//BLUE else if (mode == 3) { digitalWrite(RLED, LOW); digitalWrite(GLED, LOW); digitalWrite(BLED, HIGH); } //PURPLE…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education