A lamp outside a front door comes on automatically when it is dark, and when someone stands on the doormat outside the front door. A pressure sensor under the mat changes from OFF (0) to ON (1) when someone stands on the doormat. The light sensor is ON (1) when it is light and OFF (0) when it is dark. Design a program to show what would happen to the lamp. Account for all possible scenarios by determining whether the pressure sensor and light sensor are ON or OFF. (HINT: Ask the user "Is it dark?" and "Is someone standing on the doormat outside the front door?")

Respuesta :

Answer:

See explaination

Explanation:

#include <iostream>

#include <string>

using namespace std;

int main()

{

string raptor_prompt_variable_zzyz;

?? standing;

?? dark;

raptor_prompt_variable_zzyz ="Is it dark?";

cout << raptor_prompt_variable_zzyz << endl;

cin >> DARK;

if (DARK=="Yes")

{

raptor_prompt_variable_zzyz ="Is someone standing on the doormat outside the front door?";

cout << raptor_prompt_variable_zzyz << endl;

cin >> STANDING;

if (STANDING=="Yes")

{

cout << "LAMP IS ON" << endl; }

else

{

cout << "LAMP IS OFF" << endl; }

}

else

{

cout << "LAMP IS OFF" << endl; }

return 0;

}

Ver imagen kendrich
ACCESS MORE