ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 8 Weeks Ago, 5 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 19 May 2017 My Price 8.00

a portion of the control software for the vehicle

Can someone help me with this C++ code? I do not know what to do after this. 

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).

 IMPLEMENTATION:

Print “left door opens “and/or “right door opens” as appropriate.  If neither door opens, print “both doors stay closed”.

 Allow user the choice to continue (select another set of options) as long or he/she wishes.

 

#include<iostream>using namespace std;int main(){bool dash_swi_l, dash_swi_r, child_lock, master_lock, l_ins_latch, l_out_latch,r_ins_latch, r_out_latch, gear;cout <<"Enter the value of the left dashboard switch (1==on, 0==off): .\n";cin >> dash_swi_l;cout <<"Enter the value of the right dashboard switch (1==on, 0==off): .\n";cin >> dash_swi_r;cout <<"Enter the value of the child lock (1==on, 0==off): .\n";cin >> child_lock;cout << "Enter the value of the master lock (1==on, 0==off): .\n";cin >> master_lock;cout <<"Enter the value of the left inside latch (1==on, 0==off): .\n";cin >> l_ins_latch;cout <<"Enter the value of the left outside latch (1==on, 0==off): .\n";cin >> l_out_latch;cout << "Enter the value of the right inside latch (1==on, 0==ff): .\n";cin >> r_ins_latch;cout << "Enter the value for outside right outside latch (1==on, 0==ff): .\n";cin >> r_out_latch;cout << "Enter the value for the gear (P==1, N, D, 1, 2, 3, R==0): .\n";cin >> gear;if (gear=='P') {if (child_lock==0) {if (master_lock==1) {if (dash_swi_l==1) || (l_ins_latch==1) || (l_out_latch==1) &&{cout <<"The left door opens.\n";}elsecout <<"The left door stays closed.\n";if (dash_swi_r==1) || (r_ins_latch==1) || (r_out_latch==1) &&{cout <<"The right door opens.\n";}elsecout <<"The right door stays closed.\n";}elsecout <<"All of the doors stay closed.\n";elsecout <<"All of the doors stay closed.\n";}return 0;}

Answers

(11)
Status NEW Posted 19 May 2017 01:05 AM My Price 8.00

-----------

Attachments

file 1495156057-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)