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
1What kind of rules protect everyone’s rights when we use each other’s content
Tanya [424]

Answer:

1. Copyright.

2. Songs and books.

Explanation:

A copyright law can be defined as a set of formal rules granted by a government to protect an intellectual property by giving the owner an exclusive right to use while preventing any unauthorized access, use or duplication by others.

For example, when an individual downloads a song owned by any record company without paying a purchase fee, it is a violation of copyright law.

A copyright can be defined as an exclusive legal right granted to the owner of a creative work (intellectual property) to perform, print, record, and publish his or her work. Also, the owner is granted the sole right to authorize any other person to use the creative work.

Hence, copyright is a kind of rules that protect everyone’s rights when we use each other’s content.

An intellectual property can be defined as an intangible creation of the human mind, ideas, thoughts or intelligence. Some examples of an intellectual property are songs, books, poems, technology, design etc.

3 0
3 years ago
Which tab is used to insert a hyperlink onto a slide?
babunello [35]

the answer is C. Insert

3 0
3 years ago
Write the pseudocode for this flowchart
MrMuchimi

Answer:

Explanation:

class TimeToSleep() {

  main bunch of stuff (string argos) {

       int age;

       string comedy;

       bool guess;

        public bool imTheMasterMethod() {

           guess = true;

           while (guess) {

              comedy = "You forgot to put the flowchart, you meathead!";

              println(comedy);

               

                scan("%d", &age);

                if (age < 18) {

                    println("Go to sleep kiddo!");

                }

           }

        }

   }

}

       

6 0
2 years ago
Who is the father of computer​
r-ruslan [8.4K]

charles babbage is the father of computer's

3 0
3 years ago
Read 2 more answers
Using the XML Document below (library with books), define the following queries in XQuery: (a) Give the titles of all Books sort
Softa [21]

Answer:

Explanation:

a)use order by clause for sorting

for $x in doc("books.xml")/bib/book order by xs:float($x/price) return $x/title (default sorted in ascending order)

or

for $x in doc("books.xml")/bib/book order by xs:float($b/price) descending  return $b/title (sorted in descending order)

b)doc("books.xml")//book[author = 'Abiteboul']

c)for $x in distinct-values(doc("bib.xml")/bib/book/author)

return <res>

<name>{$x}</name>

<count>

 {count (doc("bib.xml")//book[exists(indexof(author,$x))]) }

</count>

<res>

3 0
3 years ago
Other questions:
  • Which of the following is not considered as part of technology literacy?
    8·1 answer
  • Given an array A of size N, and a number K. Task is to find out if it is possible to partition the array A into K contiguous sub
    9·1 answer
  • 3.2 lesson practice edhesive ​
    6·1 answer
  • Explain how the operating system controls the software and hardware on the computer?
    5·1 answer
  • Write a method body for the static method isDivisibleBy5 shown below. The only NaturalNumber methods you are allowed to use are
    12·1 answer
  • Being nice take the points​
    9·1 answer
  • 3. Choose the statement that best describes a ray. A ray extends forever in both directions. B ray is a part of a line with two
    10·1 answer
  • Which is NOT one of the basic characteristics of life? What feature of Microsoft
    5·1 answer
  • What is the maximum ream size on an agile project?
    15·1 answer
  • Assume the user responds with a 3 for the first number and a 5 for the second number.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!