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
To generate a series of first ten counting number of algorithm​
Anettt [7]
Uhh i need points so i don’t fail math.
3 0
3 years ago
You develop an app, and you don't want anyone to resell it or modify it. This is an example of: A an operating system. B open so
Mars2501 [29]
The answer is C. Proprietary software is when the publisher reserves rights from licensees to modify or share the software.
5 0
3 years ago
Read 2 more answers
Write two statements to get input values into birthMonth and birthYear. Then write a statement to output the month, a slash, and
Montano1993 [528]

Answer:

1/2000

Explanation:

import java.util.Scanner;

public class InputExample {

public static void main(String [] args) {

Scanner scnr = new Scanner(System.in);

System.out.print("Enter birth month and date:");//comment this line if not needed

int birthMonth=scnr.nextInt();

int birthYear=scnr.nextInt();

String output= birthMonth+"/"+birthYear+"\n";

System.out.println(output);

}

}

if using this code the out put should be 1/2000

5 0
3 years ago
When’s The release date for Mobile legends project next phase 3 going To come
Gennadij [26K]

Answer: This Project will involve Hero Revamps, Hero Adjustments, Hero Remodels, and much more. Project NEXT is divided into 2 phases: the first phase was released on September 22, 2020, the second phase was released on June 15, 2021 and the third phase is to be released on "September 2021".

4 0
3 years ago
What is the check digit for the following original product number: 140501941 ? *
Natasha_Volkova [10]

Explanation:

I think it is 7, but I could be wrong..... sorry

8 0
3 years ago
Read 2 more answers
Other questions:
  • Retail price data for n = 60 hard disk drives were recently reported in a computer magazine. Three variables were recorded for e
    13·1 answer
  • What is html?
    9·2 answers
  • Which of the following is a key component to your individual internet safety? government regulations
    13·1 answer
  • When possible, you should avoid using _________ variables in a program?
    11·1 answer
  • Preesure is drived quantity? why​
    15·2 answers
  • "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the user must repeat the sequen
    5·2 answers
  • Given an array of integers and the size of the array, write a function findDuplicate which prints the duplicate element from the
    11·1 answer
  • What is the CSS property used to style text as all lowercase or uppercase?
    14·2 answers
  • One lap around a standard high-school running track is exactly 0.25 miles. Write the function miles_to_laps() that takes a numbe
    8·1 answer
  • Does any of yall play rob lox?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!