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]
3 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]3 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
What do you think about the future of Moore’s Law? Will it continue to hold true? Will other technologies help us keep on track?
Sveta_85 [38]

There will come a time when Moore's law can no longer hold true. Past a certain point, it will be physically impossible to make a transistor any smaller. Microscopic technology will always be limited by the size of an atom. Yes, Moore's law can be regarded as a self-fulfilling prophecy, because tech companies do not want to fail to keep up with it.

4 0
3 years ago
12. Which of the following is CourseBit®? (1 point)
Annette [7]
<span>12. Which of the following is CourseBit®? 
</span><span>a leading Moodle™ development and hosting provider that focuses on highly customized systems
</span>
<span>13. In Blender®, which interface principle corresponds to the user interface that allows a user to view all options and tools at a glance with pushing or dragging editors around?
non-overlapping

Hope this helps.</span>
4 0
3 years ago
A workstation’s user prefers KDE over GNOME. Which login manager can this user run to ensure direct login to KDE?
Mice21 [21]

Answer:

B. KDM

Explanation:

The KDE display manager (KDM) was developed for the KDE desktop environment, while the GDM is a display manager for the gnome desktop environment.

The XDM display manager is used by the Linux operating system when a specific desktop environment is not chosen.

3 0
4 years ago
What is the code i need to do
Greeley [361]
What section is it? I did the same thing a bit ago on edhesive
3 0
3 years ago
What is the result of successfully applying a Machine Learning (ML)<br> algorithm to analyze data?
DIA [1.3K]

Answer:

Machine Learning algorithms can predict patterns based on previous experiences. These algorithms find predictable, repeatable patterns that can be applied to eCommerce, Data Management, and new technologies such as driverless cars..

5 0
3 years ago
Other questions:
  • Many people use Wikipedia as a reference for computing papers, and getting additional information about a topic. How reliable is
    15·1 answer
  • The only type of donation you can make to a not for profit is to donate money
    10·1 answer
  • Which statement does NOT describe working with text in presentation programs?
    13·2 answers
  • A set of parentheses that contain zero or more arguments
    12·1 answer
  • Certain high-performance vehicles use a dry sump system because it allows for A. more power. B. longer periods of cornering and
    10·2 answers
  • And tags are examples of stand - alone tags.
    15·1 answer
  • Helppppp mee eeeee eee
    14·2 answers
  • Which statement creates a StudentIDs object given the following code: public class StudentIDs&gt; { private TheType item1; priva
    15·1 answer
  • Ok it is important aspects which is perfect
    10·1 answer
  • Fill in the blank to complete the sentence.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!