answer.
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
lilavasa [31]
1 year ago
12

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

that it has been passed so far. So, if you make these calls to averager, averager(5.0), averager(15.0), averager(4.3), the values returned will be (respectively): 5.0, 10.0, 8.1. Hint: use a static local variable to track the average of all the numbers been called.
Computers and Technology
1 answer:
lys-0071 [83]1 year ago
4 0

Answer:

Following are the definition of function  

double averager (const double &x)  // function definition

{

static double z = 0.0;  // variable declaration

static size_t c = 0;

 c=c+1;  // increment of c by 1

z =z+ x;  // adding value  

return z /c ;   // return average  

}

Explanation:

Following are the description of statement  

  • Create a function averager of double type that holds a parameter "x" of the double type .
  • In this function we declared a variable "z" of a static double type that value is initialized by 0.
  • The static variable is used to retain value.
  • Declared a variable "c" of size_t type that holds a value 0 .
  • After that increment the value of c by 1 .
  • adding the value of "z" variable to the "x" and storing the result into the z variable.
  • Finally return the average value  
You might be interested in
Constantine forms the following hypothesis. Let n be any non-negative number that meets the following condition: when n is divid
notka56 [123]

Answer:

n=5

Explanation:

if n= 5

i.     n/5=5/5=1  so it divides completely the remainder is 0

ii.  97 - 6(5) = 97 - 30 = 67,   67 is a prime number.

8 0
2 years ago
You work for a shipping company and your manager receives orders from various customers everyday some existing ,some new .your m
Gennadij [26K]

Answer:

It's good to consider this as a dictionary, with key-value pair, or as a two-dimensional array.

And in the first case, the code will be as below:

day_i={'Bob':'100', 'Alice':'100','Celia':'110','Bob':'200'}

for k, v in day_i.items():

print(k, v)

Explanation:

The above code reads through each day, and each customer purchase amount in the form of Dictionary, and prints each customer name and purchase amount. And with little enhancement, we can create each day data, and print details of the day, as being asked by the user.

6 0
2 years ago
What is a commonly publicized password sql injection string?
aleksley [76]
The strings "or 1=1" and ""or ''=''"  can be commonly used to trick an SQL WHERE clause into becoming true.

So if you specify <span>' or ''=' as a password, you can log in if the query string would be:

</span><span>select username,pass from users where username='you' and password='' or ''='<span>' limit 0,1;</span></span>
7 0
2 years ago
When onboard and facing the bow of a boat where is the port side
topjm [15]

Answer:

im pretty sure this is common sense

Explanation:

3 0
2 years ago
Write a function that takes a string like 'one five two' and returns the corresponding integer (in this case, 152). A function j
Lelu [443]

Answer:

see explaination

Explanation:

def words2number(s):

words = s.split()

numbers = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']

result = ""

for word in words:

if word in numbers:

result += str(numbers.index(word))

return result

4 0
2 years ago
Read 2 more answers
Other questions:
  • 1. Accessing calendars, contact information, emails, files and folders, instant messages, presentation, and task lists over the
    12·1 answer
  • Show how to define a view tot_credits (year, num_credits), giving the total number of credits taken by students in each year
    8·1 answer
  • You have been tracking your exercise routine, which involves running, lifting weights, yoga, and stretching. You want to see wha
    15·2 answers
  • Someone else can drive your car if _____.
    12·2 answers
  • Mara's presentation included essential information about the company's new safety procedures. She wanted to make
    13·2 answers
  • Suppose your name was George Gershwin. Write a complete program that would print your last name, followed by a comma, followed b
    11·2 answers
  • Sites like Zillow get input about house prices from a database and provide nice summaries for readers. Write a program with two
    12·1 answer
  • A function defined beginning with void SetNegativesToZeros(int userValues[], ... should modify userValues such that any negative
    12·1 answer
  • Stan’s assignment is to print a three-dimensional image on a piece of paper. Which printing technique should he use?
    14·2 answers
  • You would like the user of a program to enter a customer’s last name. Write a statement thaUse the variables k, d, and s so that
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!