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 rolls two dice until the user gets snake eyes. You should use a loop and a half to do this. Each round you
marishachu [46]

import random

num_rolls = 0

while True:

   r1 = random.randint(1, 6)

   r2 = random.randint(1, 6)

   print("Rolled: " + str(r1) + "," + str(r2))

   num_rolls += 1

   if r1 == r2 == 1:

       break

print("It took you "+str(num_rolls)+" rolls")

I added the working code. You don't appear to be adding to num_rolls at all. I wrote my code in python 3.8. I hope this helps.

4 0
3 years ago
In a relational database application, a(n) ________ key is used to link one table with another.
mr_godi [17]

In a relational database application, a <u>foreign key</u> is used to link one table with another.

<h3>What is a foreign key?</h3>

In database management system (DBMS), a foreign key can be defined as a column whose value provides a link between the data that are stored in a table or relational database.

This ultimately implies that, a <u>foreign key</u> is used to link one table with another in a relational database application.

Read more on keys here: brainly.com/question/8131854

#SPJ12

6 0
1 year ago
Which of the following is true about a hot site?
swat32

Answer:

Option(d) is the correct answer to the given question.

Explanation:

A hot site is a place off site in which the task of a corporation could restart during a massive failure.The hot site seems to have all the needed equipment for such the corporation to schedule the normal activities, such as phone jacks, replacement data, laptops, and linked devices.

  • The main objective of hot sites provide an useful backup mechanism for any corporation that wishes to pursue its business in the presence of exceptional circumstances or events.
  • All the others options are not related to hot site that's why they are incorrect option.
8 0
3 years ago
URLs are the global ______ of resources on the Internet.
adell [148]
I believe the answer might be addresses 
 <span />
4 0
3 years ago
Read 2 more answers
1. Bluetooth
Elza [17]

Complete Question:

1. A wireless technology standard for exchanging data over short distances

2. A particular brand of mobile phone/PDA

3. A network that operates over a limited distance, usually for one or a few users

1. Bluetooth

2. PAN

3. Blackberry

Answer:

1. Bluetooth 2. Blackberry . 3. PAN

Explanation:

1. Bluetooth is a wireless technology standard, used in order to exchange data between mobile devices, like smartphones, tablets, headsets, wearables, over short distances in a one-to-one fashion (which means that it is not possible to build a network based in Bluetooth).

2. Blackberry is a brand of mobile phones/PDAs, very popular a decade ago, because it was the first one to allow mobile users to access e-mails and messages from anywhere, at any time.

3. PAN (Personal Area Network) is an ad-hoc network that it is only available for data exchange at a very short distance, within the reach of a person, i.e. a few meters as a maximum.

It is thought to allow someone to interact with his nearest environment (laptop, tablet, PDA) and it can be wireless (like Bluetooth) or wired (via USB cables).

4 0
3 years ago
Other questions:
  • Within the hardware of the personal computer temporary memory is known as
    10·2 answers
  • i got a set of headphones and when i plug them into my speakers the right side only works how do i fix the left side of them
    12·1 answer
  • Be able to list a technology-based company and discuss whether it enjoys sustainable competitive advantage based on the resource
    13·1 answer
  • Which of these statements regarding​ time-cost tradeoffs in CPM networks is​ true?
    6·1 answer
  • Alguien me puede ayudar a arreglar mis auriculares que mi perro rompió en el conector
    5·1 answer
  • How can i change my age on my profile here bc i am 13 but i accidenlty put 2005 instead of 2006 no need to rush to answer just w
    9·2 answers
  • Security breaches are easier to address with which payment form?
    11·2 answers
  • The post-closing trial balance shows the balances of only the ____ accounts at the end of the period.
    12·1 answer
  • How to clear a function in functional component react.
    6·1 answer
  • What is a simple definition for electricity?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!