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
SOMEONE PLZZ HELP ME ASAP!!
Sever21 [200]

C

because you have to re read it

8 0
3 years ago
Read 2 more answers
Changing the configuration of a database falls under which category of databaseâ administration?
harkovskaia [24]
Changing the configuration of a database falls under which category of databaseâ administration?

d. operation
8 0
3 years ago
What is presentation
Gelneren [198K]
To present something infront of a crowd
5 0
2 years ago
Read 2 more answers
ASAP PLS HELP: I’ll give brainliest if you u answer them all correctly!!
ra1l [238]

Answer:

1 c

2 a

3 c

4 b

5 c

6 b

7 d

8 a

9 d

10 b

6 0
3 years ago
Read 2 more answers
The L-exclusion problem is a variant of the starvation-free mutual exclusion problem. We make two changes: as many as L threads
vladimir2022 [97]

Answer:

The solution is as follows.

class LFilters implements Lock {

int[] lvl;

int[] vic;

public LFilters(int n, int l) {

lvl = new int[max(n-l+1,0)];

vic = new int[max(n-l+1,0)];

for (int i = 0; i < n-l+1; i++) {

lvl[i] = 0;

}

}

public void lock() {

int me = ThreadID.get();

for (int i = 1; i < n-l+1; i++) { // attempt level i

lvl[me] = i;

vic[i] = me;

// rotate while conflicts exist

int above = l+1;

while (above > l && vic[i] == me) {

above = 0;

for (int k = 0; k < n; k++) {

if (lvl[k] >= i) above++;

}

}

}

}

public void unlock() {

int me = ThreadID.get();

lvl[me] = 0;

}

}

Explanation:

The code is presented above in which the a class is formed which has two variables, lvl and vic. It performs the operation of lock as indicated above.

6 0
3 years ago
Other questions:
  • When the packet leaves the router, which source and destination ip addresses will be contained in the packet?
    9·1 answer
  • true or false manual handling of materials accounts for the primary source of energy in the workplace
    13·2 answers
  • • Suppose Host A wants to send a large file to Host B. The path from Host A to Host B has three links, of rates R1= 500 kbps, R2
    15·1 answer
  • Which type of computer is the best? laptop, tablet, or desktop
    15·2 answers
  • Betrand Meyer developed the ______ programming language which is not type-safe because it violates the law of contravariance.
    9·1 answer
  • Which technology will a business use to figure out who accessed confidential files on a company's computer system
    12·1 answer
  • Mention five features on the desktop screen​
    5·1 answer
  • How will Artificial Intelligence change the way we do things? .......C-Claim:
    10·1 answer
  • Cómo se llaman los robots que se utilizan para la exploración espacial, en medicina, en la industria, en la agricultura, los que
    13·1 answer
  • The computer stores currently used programs and data in ________.
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!