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
Lina20 [59]
2 years ago
10

Write the definition of a function named newbie that receives no parameters and returns true the first time it is invoked (when

it is a "newbie"), and that returns false every time that it is invoked after that.
Computers and Technology
1 answer:
kondaur [170]2 years ago
7 0

Answer:

The function definition to this question can be described as follows:

bool newbie() //defining a bool method newbie

{

static bool y = true ; // defining a static bool variable y and assign value true

bool t1=y; //defining bool variable t1 and assign value of variable y

y=false; // assigning value in variable y

return t1; // return value of variable t1

}

Explanation:

The program to this question can be described as follows:

Program:

#include <iostream> //defining header file

using namespace std;

bool newbie() //defining a bool method newbie

{

static bool y = true ; // defining a static bool variable y and assign value true

bool t1=y; //defining bool variable t1 and assign value of variable y

y=false; // assigning value in variable y

return t1; // return value of variable t1

}

int main() //defining main method

{

int s,s1; //defining integer variable s,and s1

s=newbie(); // variable s that call method

cout<<s<<endl; //print value

s1=newbie();//variable s that call method

cout<<s1;  //print value

return 0;

}

Output:

1

0

Description:

The description of the above function can be described as follows:

  • In the above method definition a boolean method "newbie" is declared, which can't accept any parameters, inside the method, two boolean variable "y and t1" is declared.
  • In this variable, variable y is a static boolean variable, that assigns a true value, and in t1 variable, we hold static variable value.  
  • In the next step, the "y" variable assigns a value, that is false and returns variable t1 value.
  • In the next step, the main method is declared, inside these two integer variable s, s1 is declared, that calls a method, and prints it value in the first time, it will print 1, that means the false and second time it will print 0, that means false.
You might be interested in
3. You are a network administrator responsible for all network platforms and services. The Teta Company currently has only one b
solniwko [45]

Answer:

1. Wired networks may give the appearance of a busy office full of the latest equipment, but in reality, wires can be an inefficient networking medium. They can limit signal strength as well as make it more difficult to expand and reorganize your network configuration.  Wireless networking is a viable and affordable alternative that offers the benefits of making your environment more flexible. A wireless infrastructure allows you to effortlessly reconfigure your office space as your company grows and changes, easily extend connectivity and also allows employees to be mobile more easily.

2. Review the advantages and consider the benefits to your organization:

Reduced cost of installation. It may be significantly less expensive to install wireless access points compared to wiring your office with Ethernet capabilities.

Flexibility. If you regularly expand or reorganize your office space, or need to accommodate a variety of network configurations, the rapid transition time from one configuration to another that wireless provides can help reduce your network downtime. In addition, you won't have to incur the costs associated with physically rewiring office space.

Convenient information access. With wireless, you'd have the ability to extend access to key information to anyone on your staff, from anywhere in the office, even when they aren't physically connected to your wired local area network (LAN) connection. Do members of your staff regularly work away from their desks or stations, but could benefit from anytime, anywhere access to important data? Could you improve productivity by increasing access to important company systems? Do you have business processes you could streamline by reducing the number of times employees have to go back to their wired connections?  Wireless LANs are the way to go, especially where there's no existing wired network. This is especially true in leased offices, where you can't go knocking holes in walls.

Your next step is to actually build a wireless LAN, which you'll do just like this:

Identify the equipment you want to buy, such as wireless notebooks, access points, wireless LAN adapters and wireless cards.

Determine the number of users who need to have access to the network. This will help you determine the number of access points you'll need.

Plan for the connection to your wired LAN, probably in a central location and in an open environment. Your goal is to maximize the access point's wireless range. The quoted range is a maximum of 300 feet, but that's very dependent on the existing environment--walls, water pipes, cables and so on all could decrease the range. The best thing to do is complete a site survey first; if that's not possible, assume a maximum range of 150 feet, as 300 could decrease throughput.

8 0
3 years ago
Read 2 more answers
"This part of the computer fetches instructions, carries out the operations commanded by the instructions, and produces some out
Inessa05 [86]

Answer:

CPU

Explanation:

CPU stands for Central Processing Unit, also called: Central Processor or Main Processor.

The CPU is the electronic circuitry within a computer that carries out the instructions of a computer program by performing the basic arithmetic, logic, controlling, and input/output operations specified by the instructions.

4 0
3 years ago
I need a solution for this problem asap.
madreJ [45]

Answer:

Hold on just a second I will be giving soon,

5 0
2 years ago
Assume that nextWord is a String variable that has been given a String value consisting entirely of letters. Write some Java cod
wel

Answer:

The code example is given below with explanation in c++ language.

Explanation:

Comments will explain what's going on in the code. Below code is already compiled and tested.

#include <time.h>

#include <iostream>

#include <sstream>

using namespace std;

int main(void)

{

//defining start and end time variable

// which will be used to break the infinte loop

   time_t endwait;

   time_t start = time(NULL);

   time_t seconds = 3; // end loop after this time has elapsed

cout<<"Input your number :";

long userNum;

cin>> userNum;

// initializing end time by adding seconds with start time

   endwait = start + seconds;

   // defining outputString which will concatenate all the  

   // divisible numbers in loop

string outputString="";

// bool isCompleted will use to check whether our  

// loop breaks successfully or time is expired.

bool isCompleted=true;

// iterate loop until it comes to 1. as in loop

// the program already displayed the 1 value.

   while (userNum>1)

   {  

  // checking start and end time comparison to  

  // break the infinite loop after some seconds

    if(start >= endwait){

     cout<< "Program end never reached.";

     isCompleted=false;

     break;

 }

 

    userNum=userNum/2;

   // defining stringstream to convert from long to string

    stringstream longToString;

    longToString<<userNum;

  // concatenating all the values

    outputString = outputString + longToString.str()+" ";

   // re initializing the start time with current time.

       start = time(NULL);

   }

   

  // check if while loop breaks successfully then print the

   // series of numbers here.

   if(isCompleted) {

    cout << outputString;

}

   return 0;

}

8 0
3 years ago
What is the purpose of the making of Nintendo Switch?
Elden [556K]

Answer:

To create a console that is suitable for children and families.

7 0
3 years ago
Read 2 more answers
Other questions:
  • ____ is the name of a particularly nasty automated program that attacks a network by exploiting Internet Protocol (IP) broadcast
    15·1 answer
  • Your sister asks you if it is possible to get an office productivity suite for free. What do you tell her?
    13·1 answer
  • The software that displays the resulting web pages is​
    9·1 answer
  • Which element is represented by the electron configuration in example B? Example B: 1s22s22p63s23p64s1 Aluminum Cesium Potassium
    12·2 answers
  • Hey guys, I don’t have a problem for you but If anyone knows do you still pass your grade level if you failed 1 class in the las
    11·2 answers
  • Which area of government regulations do the Fair Credit and Reporting Act
    8·2 answers
  • What is the benefit of hosting a website on a personali
    6·1 answer
  • Plsssssssss help me​
    8·1 answer
  • Which browser feature will delete your history, cache, and cookies the moment you close the special window
    6·1 answer
  • (Synchronized threads) Write a program that launches 1000 threads. Each thread adds a random integer (ranging from 1 to 3, inclu
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!