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
Write a program that converts or calculates values. Use the following guidelines to write your program:
Setler [38]

Answer:

In Section 2.2 “Expressing Units”, we showed some examples of how to ... with other units of the same type to get a numerical value that is easier to comprehend. ... The rules of algebra say that you can change (i.e., multiply or divide or add or ... We see that one-half of a yard equals 3/2, or one and a half, feet—something Explanation:

8 0
2 years ago
Discuss the differences between dimensionality reduction based on aggregation and dimensionality reduction based on techniques su
abruzzese [7]

Answer:

Following are the difference to this question can be defined as follows:

Explanation:

  • In terms of projections of information into a reduced dimension group, we can consider the dimension structure of PCA and SVD technologies.  
  • In cases of a change in the length, based on consolidation, there's also a unit with dimensions.
  • When we consider that the days have been aggregated by days or the trade of a commodity can be aggregated to both the area of the dimension, accumulation can be seen with a variance of dimension.
5 0
3 years ago
Which 1898 film did George Melies create using camera trickery to create a illusion in which we now
8_murik_8 [283]

Answer:

four heads are better than one

Explanation:

4 0
2 years ago
Topological sort requires only a tiny addition to the DFS algorithms. Exactly one of the following data structures is required t
Alekssandra [29.7K]

Answer:

Stack.

Explanation:

Topological sort requires a bit of addition to DFS algorithm.So DFS can be done by two ways that are either you can use recursion or you can use Stack data structure to implement DFS.

Since recursion uses stack memory when it makes recursive calls and if you want to do it iteratively you can stack data structure.

8 0
2 years ago
What is the primary difference among a domain model, an analysis model, and a design model for the same project?
Aleks04 [339]

Answer:

The design model is the description of the model to be implemented, the analysis model is the model that links the design and the system or domain model while the domain model is the entire software implementation.

Explanation:

The domain model is the conceptual aspect of software engineering that comprises operational and data features. The analysis model is the schematic description of the system that links the design model to the system domain. The design model is also known as the object model as it shows an abstract representation of the implementation. It helps to test the quality of the software been developed.

8 0
2 years ago
Other questions:
  • ) The ________ displays a text box and button for users to browse, select, and upload a file. (Points : 3)
    13·1 answer
  • How do you spell kiss in Japanese
    13·2 answers
  • How can an Excel table be added to a Word document? Check all that apply.
    15·1 answer
  • When was internet started in which year​
    13·2 answers
  • Which statement is not true? An audit objective for systems maintenance is to detect unauthorized access to application database
    8·1 answer
  • Can I use some Company's name in my Research Project. For example, my research is based on E-commerce security and i wanna use A
    14·1 answer
  • Numerical methods are implementations of mathematical algorithms, but constructed with special consideration for accuracy of sol
    7·1 answer
  • Dominic's teacher asked him to create a chart or graph to compare the different grade levels in the school's FBLA club. Which ch
    5·2 answers
  • Xbox one is not turning on and power brick is orange why is that?​
    6·1 answer
  • 2. What is MOST TRUE of a mature technology?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!