answer.
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
Masteriza [31]
2 years ago
13

Simulate a circuit for controlling a hallway light that has switches at both ends of the hallway. Each switch can be up or down,

and the light can be on or off. Toggling either switch turns the lamp on or off. Provide member functions.
Computers and Technology
1 answer:
Dmitry [639]2 years ago
5 0

Answer:

int switch_1,switch_2;

int get_first_switch_state()

{

return switch_1;

}

int get_second_switch_state()

{

return switch_1;

}

int get_lamp_state()  

{

if((get_first_switch_state())

if(get_second_switch_state()) return 1;

else

if(!get_second_switch_state()) return 1;

return 0;

}

void toggle_first_switch()

{

  if(get_first_switch_state()) switch_1=0;

  else switch_1=1;

}

void toggle_second_switch()

{

if(get_second_switch_state()) switch_2=0;

else switch_2=1;

}

Explanation:

You might be interested in
1.21 LAB: Divide by x
dangina [55]

Answer:

Explanation:

The following code is written in Python. It is a function called divide_by_x and takes the user inputs as described. It then raises x to the third power and divides user_num by that number. This gives the same result as user_num divided by x three times. The answer is saved in the variable answer which is then returned to the user.

def divide_by_x(user_num, x):

   answer = user_num / (x**3)

   return answer

3 0
2 years ago
Read 2 more answers
Annabeth has been using a public cloud to store and access her documents. Which drawback of a public cloud should she be aware o
Flura [38]

<u><em>i just to the test on Plato and it said that A. accessibility is wrong  the correct answer is d  security #homeschoolrocks</em></u>

5 0
2 years ago
Which of these is an advantage of using the Clipboard task pane? A. You are able to apply OLE easily. B. There are more paste op
NemiM [27]
Hi!

The Clipboard in Microsoft Word is great for having more than just one paste option via the paste command. 

Using the Clipboard, you can hold up to 24 items that are copied. This makes it efficient if you have a lot of data you would like to paste.

Hopefully, this helps! =)
4 0
2 years ago
Read 2 more answers
Write multiple if statements: If carYear is before 1968, print "Probably has few safety features." (without quotes). If after 19
jekas [21]

Answer:

Following is the statement in the C language :

if(carYear < 1968)

printf("\nProbably has a few safety features.\n");

if(carYear > 1970 && carYear <=1991 )

printf("\nProbably has head rests.\n");

if(carYear > 1991 && carYear <=2002)

printf("\nProbably has anti-lock brakes\n.");

if(carYear > 2002)

printf("\nProbably has airbags.\n");

Explanation:

Following is the description of the statement:

  • In the given question we used if block. The if block is only executed when their condition is true.
  • if(carYear < 1968) In this we check we the value of "carYear" variable is less then 1968 then it prints "Probably has a few safety features." in the console window.
  • if(carYear > 1970 && carYear <=1991) In this we check we the value of "carYear" variable is greater then 1970 and less then 1992 it prints "Probably has head rests" in the console window.
  • if(carYear > 1991 && carYear <=2002 ) In this we check we the value of "carYear" variable is greater then 1991 and less then 2003 it prints "Probably has anti-lock brakes" in the console window.
  • if(carYear > 2002) In this we check we the value of "carYear" variable is greater then 2002 then it prints "Probably has airbags" in the console window.

6 0
2 years ago
Wendy is an attacker who recently gained access to a vulnerable web server running Microsoft Windows. What command can she use t
VikaD [51]

Answer:

I would say that if she is connected to the server and has grained access to the server, Wendy would have to use the command shortkey win+r (to run) or she could just use the "Type here to search" function.

Then you can type the words "cmd" to bring up the command prompt

Lastly, she would need to use the protocol scp to transfer files. Wendy might need to include a destination for the files to be directed to.

7 0
1 year ago
Other questions:
  • Sharon reads two different articles about avocados. The first article, in a weight loss magazine, claims that avocados are unhea
    10·2 answers
  • In 2–3 sentences, describe how you would change the background of a group of cell
    6·2 answers
  • Why is the following statement true - ideally, your information is abbreviated
    10·2 answers
  • Lyrics = ["I wanna be your endgame", "I wanna be your first string",
    5·1 answer
  • Show the stack with all activation record instances, including static and dynamic chains, when execution reaches position 1 in t
    10·1 answer
  • For a class project, Jerome builds a simple circuit with a battery and three light bulbs. On his way to school, Jerome drops his
    9·1 answer
  • Complete function PrintPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 3, print "To
    9·1 answer
  • Which option in the Caption dialog box configures whether the caption appears above or below the image
    11·2 answers
  • Put the steps in order to produce the output shown below. Assume the indenting will be correct in the program.
    6·1 answer
  • The most likely reason a firm would decide to establish an extranet would be the desire to Multiple Choice speed the flow of inf
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!