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
MA_775_DIABLO [31]
3 years ago
10

Write the definition of a function named alternator that receives no parameters and returns true the first time it is invoked, r

eturns false the next time it is invoked, then true, false and so on, alternating between true/false on successive invocations.
Computers and Technology
1 answer:
Nataly [62]3 years ago
3 0

Answer:

The solution code is written in C++

  1. bool STATUS = true;
  2. bool alternator ()
  3. {
  4.    if(STATUS){
  5.        STATUS = false;
  6.        return true;
  7.    }else{
  8.        STATUS = true;
  9.        return false;
  10.    }
  11. }

Explanation:

We need a global variable to track the status of true or false (Line 1).

Next, create the function alternator (Line 2) and then check if current status is true, set the status to false but return the previous status boolean value (Line 5-6). At the first time of function invocation, it will return true.

The else block will set the STATUS to true and return the false (Line 7-9).

You might be interested in
Assume you are a manager in the security department of a high-tech corporation. You are mentoring Mary, an entry-level network t
nadya68 [22]

Answer:

Seek a bachelor's degree.

Explanation:

Seems more compromised and education from people with experience already.

6 0
3 years ago
Who played a leading role in perfecting movable type for printing?
vaieri [72.5K]
Johannes Gutenberg, although there are various examples of movable type from China (and Korea, to a lesser extent).
6 0
3 years ago
The first row in a table is referred to as the _____ row and the last row is considered the _____ row.
Juliette [100K]

the first row in a table is classed as the header row.

and with the last one I'm not sure because as far as I know there's not considered a last row.

6 0
3 years ago
A support technician uses the ping utility on a system that is online, yet no response is received. What should be allowed throu
alexgriva [62]

Answer:

Internet Control Message Protocol (ICMP) Echo Requests

Explanation:

A system that has Windows Firewall or antivirus or other third party antivirus enabled with their configuration setting set to default, ping command from another device will not be able to see if the device with an enabled firewall is alive.

The ping command sends Internet Control Message Protocol (ICMP) Echo Request to a destination device after the destination device will reply with a Reply packet. However, by default, firewalls, such as Windows firewall blocks ICMP Echo Requests from the external network and pinging will  work when the firewall is disabled or an exception is created that lets ICMP Echo Requests pass through the firewall.

4 0
3 years ago
Computer are most wonderful creation of 21st century how ?​
son4ous [18]

Answer:

It can do all the functions at a speedy rate and also helps us to search and progress in our homes and businesses. A computer can therefore be called a calculator with a twist for not only does it perform fast calculations, but it also has other special characteristics.

Explanation:

hope it helps you

6 0
2 years ago
Other questions:
  • An sObject named Application _c has a lookup relationship to another sObject named Position_c.
    12·1 answer
  • Discuss a situation in which you might want to use a floating-point number with a fractional part for a loop control variable. W
    5·1 answer
  • A retail company must file a monthly sales tax report listing the total sales for the month and the amount of state and county s
    11·1 answer
  • Which feature is used to summarize data from multiple worksheets but does not require that the data be in the same location on e
    12·1 answer
  • If you want Nud3s add me on sc Kermit4lyfe1
    11·2 answers
  • A circuit breaker will do which of the following
    12·1 answer
  • There are many apps that help find you cheaper gas. If the cost of a gallon of regular gas is $3 at one station and $3.50 at ano
    15·1 answer
  • Which software manages the functioning of the entire computer system<br>​
    7·2 answers
  • Who is the best nfl team in your mind
    14·2 answers
  • How do you create a CA file? short answer
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!