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
Your computer uses 4 bits to represent decimal numbers (0, 1, 2, 3 and so on) in binary. What is the SMALLEST number for which a
natali 33 [55]
2 I think because 2 I think is binary I’m sorry if this is wrong
8 0
2 years ago
What are some ways to insert a row or column? Check all that apply.
kondaur [170]

Answer:

There are two ways to insert the new column or row in the table.

Explanation:

<u>Method I</u>

i. Select the cell where you want to add a new row or column,

ii. Click on Home Tab

iii. Find insert button in Cells Group.

iv. Click on Insert Row or Insert Column button.

By following above mentioned steps we can add a row or column in Excel sheet.

<u>Method II</u>

i. Select the cell where you want to add a new row or column,

ii. Right Click on the selected Cell.

iii. Find Insert Button in drop down menu and Click on Insert.

iv. There are four options in POP menu, choose Entire Row or Entire Column to insert row or column.

4 0
3 years ago
Read 2 more answers
Choices.
Svet_ta [14]

Answer:

1. B

2. D

3. C

4. A

5. B

Explanation:

1. To check the integrity of your hard disk and fix various file system errors, the Windows utility which should be implemented is Check disk (Chkdsk). This utility is always used with the command line interface (CLI) with the command "chkdsk."

2. An event or action took place and it caused damage to data, hardware, software and processing capability of the computer. From the statement given, security risks are being described. Any event or action that is capable of causing a problem to a computer system is considered to be a security risk and should be prevented through the use of an appropriate utility software.

3. Virus is a software program that can infect, damage and disrupts the whole computer system.

4. To protect the whole computer system, the software utility which is needed is an Anti-virus.

5. To avoid losing valuable data to your computer, the most important thing to do is to regularly back-up your files.

7 0
2 years ago
2. A shift register can operate:
Naddik [55]
C. Both serially and Perullo
8 0
3 years ago
True or False <br><br> Rootkits are only made by black-hat hackers.
andreyandreev [35.5K]

Answer:

True

Explanation:

Rootkits are malicious software that allows an unauthorized user to access a computer and restricted areas of software. Rootkits are difficult to detect on your computer because it may be able to subvert there that is intended to find it. Rootkits are created by Black-hat hackers to attack your computer and steal.

Rootkit tools:

1. Keyloggers

2. antivirus disablers

3. password stealers

4. banking credential stealers

5. bots for DDoS attacks

8 0
3 years ago
Other questions:
  • Using the flowchart below, what value when entered for Y will generate a mathematical error and prevent our flowchart from being
    14·1 answer
  • Write a program that reads numbers from a file (or allow user to input data) and creates an ordered binary tree. The program sho
    8·1 answer
  • Directory servers from different vendors are synchronized through ________.
    9·1 answer
  • 7.) Title text boxes on every slide must be the same format. <br> A. True <br> B. False
    15·2 answers
  • Write a program to generate a square wave with 80% duty cycle on bit P2.7 Microprocessor.​
    7·1 answer
  • User Interface Design ensures that the interface has elements that are easy to ________________. (Choose all that apply)
    10·2 answers
  • What is the data type of the following expression?
    12·2 answers
  • What is the relationship between agile teams and project requirements
    9·1 answer
  • If consumers start to believe they need a product, what is likely to happen
    15·1 answer
  • Write a Pascal program that will prompt the user to enter the radius of a circle.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!