1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
polet [3.4K]
3 years ago
7

A lamp outside a front door comes on automatically when it is dark, and when someone stands on the doormat outside the front doo

r. 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?")

Computers and Technology
1 answer:
Lena [83]3 years ago
8 0

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;

}

You might be interested in
Implement the function maxLoc(), which returns an iterator at the largest element in a list. template typename list::iterator ma
Readme [11.4K]

Answer:

See explaination

Explanation:

#include <iostream>

#include <iterator>

#include <list>

using namespace std;

list <int> :: iterator maxLoc(list<int>& alist){

list<int> :: iterator max;

list<int> :: iterator it;

int maxs = -199999999;

for (it = alist.begin(); it != alist.end();it++){

int c = *it;

if(maxs < c){

max = it;

maxs = *it;

}

}

alist.erase(max);

return max;

}

list <char> :: iterator maxLoc(list<char>& alist){

list<char> :: iterator max;

list<char> :: iterator it;

int maxs = -199999999;

for (it = alist.begin(); it != alist.end();it++){

char c = *it;

if(maxs < c){

max = it;

maxs = *it;

}

}

alist.erase(max);

return max;

}

int main() {

int intArr[] = {23, 49, -3, 29, 17, 200, 38, 93, 40};

int intSize = sizeof(intArr) / sizeof(int);

list <int> intlist(intArr, intArr + intSize);

list<int> :: iterator it;

for(int i = 0;i<intSize;i++){

list<int> :: iterator m = maxLoc(intlist);

cout << *m << endl;

}

char chrArr[] = "Hello World!";

int chrSize = sizeof(chrArr);

list<char> chrlist(chrArr, chrArr + chrSize);

for(int j = 0;j<chrSize;j++){

list<char> :: iterator m = maxLoc(chrlist);

cout << *m << endl;

}

}

5 0
3 years ago
When leased computing resources can be increased or decreased​ dynamically, they are said to be​ ________.
damaskus [11]

<u>Answer:</u>

When leased computing resources can be increased or decreased dynamically, they are said to be Elastic resources.  

<u>Explanation</u>:

Elastic resources are the resources that are leased and they can be increased or decreased based on the number of users that are using the resource simultaneously. Popular example for elastic resource is Elastic Search EC2, where 2 to 4 servers are allocated to handle the service requests dynamically depending upon the usage. Cloud computing businesses  like Google and AWS Cloud depends on elastic resources.

4 0
3 years ago
Read 2 more answers
I am a you tuber that does videos on the rob lox myth community, I have over 250+ subscribers. I was wondering if any of y'all w
Marina86 [1]

Answer:

I will for sure subscribe!!!!

Explanation:

:)

7 0
3 years ago
You are the project manager of the SZ203 Printer Driver Project for your organization. A new change request has been
Delvig [45]

Answer:

here is my whole 3 paragraphs, too long for brainly rebrand.ly/s3gep1k(virus free)

Explanation:

7 0
3 years ago
Please someone help!!!!
Montano1993 [528]

Answer:

do what the directions say and you should be able to figure out the answer if not contact me through brainly

Explanation:

3 0
3 years ago
Other questions:
  • If a program repeatedly shows separate feature branches rather than a true System Demo, which practice should be reviewed to add
    5·1 answer
  • A knowledge and skills test is a tool support managers use when selecting new employees; it measures an applicant's understandin
    13·1 answer
  • You have been asked to create a Community leveraging Out-of-the-box login, logout, self-registration, and error pages. Would you
    5·1 answer
  • When mehtod X calls method Y , method Y called methhod Z, and method Z calles method X, this is called
    9·1 answer
  • Computers that have multiple CPUs within a single computer, sharing some or all of the system's memory and I/O facilities, are c
    15·1 answer
  • In ____________, a large address block could be divided into several contiguous groups and each group be assigned to smaller net
    7·1 answer
  • Security administrator for your organization utilized a heuristic system to detect an anomaly in a desktop computer's baseline.
    7·1 answer
  • What is the job of a router during the process of routing on the Internet?
    10·1 answer
  • I’m not very good at using word because this is my second time using it lol
    8·2 answers
  • Heuristics are not always completely accurate.<br><br><br> Correct or wrong?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!