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
Westkost [7]
3 years ago
12

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:
victus00 [196]3 years ago
5 0
Visual C++ Programming is the software where the function defined in the question can be used. The return type of the Boolean method is applied. This is the code for the function.

bool newbie()
{
      static bool x = true;
      if (x) {
           return true;
      } else {
           return false;
      }
}
You might be interested in
from january 2005 through july 2015, approximately how many electronic data records in the United States were breached, exposing
Brums [2.3K]
From January 2005 through July 2017, approximately 853 million electronic data records in the US were breached.
This allowed the attackers to take control over people's personal data, such as their various credit card numbers, and other important data, as well as their addresses, etc. The cyber police, as well as the regular police have been working hard to stop this from happening, but the hackers are very strong and smart.
4 0
3 years ago
Let S be an NP-complete problem and Q and R be two other problems not known to be in NP. Q is polynomial time reducible to S and
levacccp [35]

Answer:

B. R is NP Hard

Explanation:

Given:

S is an NP complete problem

Q is not known to be in NP

R is not known to be in NP

Q is polynomial times reducible to S

S is polynomial times reducible to R  

Solution:

NP complete problem has to be in both NP and NP-hard. A problem is NP hard if all problems in NP are polynomial time reducible to it.

Option B is correct because as given in the question S is an NP complete problem and S is polynomial times reducible to R.

Option A is not correct because R is not known to be in NP

Option C is not correct because Q is also not known to be in NP

Option D is not correct because Q because no NP-complete problem is polynomial time reducible to Q.

5 0
3 years ago
What is a file path?
adoni [48]

Answer:

Similarly, in the computer world, a path defines the location of a file or folder in a computer's file system. Paths are also called "directory paths" because they often include one or more directories that describe the path to the file or folder. A path can either be relative or absolute.

(Brainliest please)

6 0
3 years ago
Lewis wrote an informational academic paper about deer. He rereads his work and is starting to revise for academic voice.
Anna [14]

Answer: C. Some people think they can tame deer, but I just don’t buy it.

5 0
2 years ago
Read 2 more answers
Please help!!
Margarita [4]

Answer:

<h2>Server</h2>

Explanation:

<h3>i hope its help you</h3>
6 0
3 years ago
Other questions:
  • Which of the following statements is false? a. Classes (and their objects) encapsulate, i.e., encase, their attributes and metho
    15·1 answer
  • So a little back story. I'm pretty young won't say my age because I'll be judged. But I drink deer, vodlka, tequila, etc. I some
    11·2 answers
  • Write code that prints: usernum ... 2 1 blastoff! your code should contain a for loop. print a newline after each number and aft
    14·1 answer
  • Which term describes an event where a person who does not have the required clearance or access caveats comes into possession of
    15·2 answers
  • What symbol do we use to denote a character?
    9·2 answers
  • Two processes are running the same program on a computer. The operating system can set up an access restriction on the control
    7·1 answer
  • Some loops are controlled by ____ (or reducing) a variable and testing whether the value remains greater than some benchmark val
    15·1 answer
  • Which action is applicable only to tables?
    13·1 answer
  • Any song recommendations, pls dont say 6ix9ine or lil pump
    5·2 answers
  • 500 word career report, auto care
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!