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
Neporo4naja [7]
3 years ago
11

Write the definition of a function named averager that receives a double parameter and returns-- as a double -- the average valu

e that it has been passed so far. So, if you make these calls to average, averager(5.0), averager(15.0), averager(4,3), the values returned will be (respectively): 5.0, 10.0, 8.1.
Computers and Technology
1 answer:
vladimir1956 [14]3 years ago
7 0

Answer:

double averager (double &newNumber)

{

static double sum = 0.0;

static int counter = 0;

counter++;

sum += newNumber;

return sum / counter;

}

Explanation:

This exercise is for you to understand how to use variables in functions that have scope outside of the function. The static keyword before a initialising a variable whether int or double or float or string, place the variable on the STATIC MEMORY. This means that when the function ends, those static variables are still usable and can be manipulated with the same stored values.  So when the function sees the

static double sum = 0.0;

for the second time it IGNORES it and continues with the previously stored value.

You might be interested in
The ____ contains the computer's "brain," the central processing unit (CPU).
Vsevolod [243]
(not completely 100% sure) the Motherboard
6 0
4 years ago
Read 2 more answers
Choose the 3 Points in good story telling
Sidana [21]

Answer:

1.Choose a clear central message 2. Embrace conflict 3.Have a clear structure  

Explanation:

8 0
2 years ago
Technology that verifies a person's identity is _____. a smart card Automated Fingerprint Verification an EPD a digital ink pen
tresset_1 [31]
The answer is Automated fingerprint.
 Automated Fingerprint is the process that verifies a person's identity. It is primarily used for law enforcement agencies for criminal identification initiatives. It is important because it includes identifying a person suspected of committing a crime or linking suspects to unsolved crimes. 

3 0
3 years ago
Read 2 more answers
1. ___________ ensures the integrity and security of data that are passing over a network.
allochka39001 [22]

Answer:

The correct answer to the following question will be Option D (Network-security protocols).

Explanation:

  • Methods and procedures for protecting network data from unwanted information retrieval are managed by network security protocols.
  • They are a network-style protocol that guarantees the protection and privacy of data in transit through a wireless connection. It describes procedures and techniques for protecting network data from every unauthorized effort to access or remove data material.

Therefore, Option D is the right answer.

5 0
4 years ago
Write a function called simulate_several_key_strikes. It should take one argument: an integer specifying the number of key strik
Furkat [3]

Answer:

The solution code is written in Python 3

  1. import random
  2. import string
  3. def simulate_several_key_strikes(l):
  4.    char_set = string.ascii_lowercase
  5.    return ''.join(random.choice(char_set) for i in range(l))
  6. print (simulate_several_key_strikes(10))

Explanation:

The program is aimed to generate random characters and the number of characters generated is dependent on user input. Hence, we will need to import the random module (Line 1). We also import string module so that we can make use of its associated method to generate English letters (Line 2)

Next, we create the function simulate_several_key_strikes that takes one single parameter, l, as input. Within the function body, we use ascii_lowercase method to generate the lowercase letter set and assign it to char_set variable (Line 5). We use random.choice method to randomly pick one of the letter in char_set and join it with an empty string (Line 6). Please note there is a for-loop that will repeatedly generate l-number of character and eventually return it as output.

We test the function by passing 10 as input parameter and we shall get a sample output as follows:

xuiczuskoj

7 0
3 years ago
Other questions:
  • A car moves down the street at 45 kph. The driver takes his foot off the gas pedal but does not brake. Which is the correct expl
    5·2 answers
  • What is the difference between First Person Shooters and Construction Simulations?
    12·2 answers
  • What command prompts should be used to assign an IP address to:
    9·1 answer
  • Sabiendo que el engranaje motriz tiene 14 dientes y gira a 4000 RPM, y el conducido tiene 56 dientes, responde:
    11·1 answer
  • It is a field that contains a unique identifier for each record in a primary table
    5·1 answer
  • What is data that originated in another program or format?
    7·1 answer
  • Rachel is a junior system administrator for a network with a single Active Directory domain. The network has just expanded to in
    6·1 answer
  • What is the best way of transmitting data safely
    9·1 answer
  • Please help me i’ll give you brainlist
    13·1 answer
  • Alice is watching a speech over the internet. what type of message is alice attending to?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!