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
Cara is cleaning her computer when she notices a loose cable connecting to her printer. Which two ports would the cable most lik
Ann [662]

Answer:  USB-C

I am 99.5% sure bcuz Im about 90 % because HDMI goes into TVs and stuff

4 0
2 years ago
Read 2 more answers
The merge and center
elena-s [515]

Answer:

True

Explanation:

Merge & Center is a feature in excel that combines multiple cells and centers the contents of the first cell. You can merge columns and rows too.

8 0
2 years ago
Define a function called 'findWordFreq, which takes two parameters. The first parameter, 'text" is an nltk.text.Text object and
MakcuM [25]

Answer:

import os

import nltk

import zipfile

from nltk. corpus import gutenberg

from nltk. text import Text

def findWordFreq(text, word):

   textfreq = nltk. FreqDist(text)

   wordfreq = nltk.FreqDist(word)

   maxfreq = max(textfreq)

   return wordfreq, maxfreq

if -_name__ == '__main__':

   text = input()

   word = input()

   if not os.path.exists(os.getcwd() + "/nltk_data"):

       with zipfile.ZipFile("nltk_data.zip", 'r') as zip_ref:

           zip_ref.extractall(os.getcwd())

   os.environ['NLTK_DATA'] = os.getcwd() + "/nltk_data"

   text = Text(gutenberg.words (text))

   word_freq, max_freq = findWordFreq(text, word)

   print(word_freq)

   print(max_freq)

Explanation:

The natural language package in python is used to get and analyse word from voice input. The python code above get words from a zipfile extract, and the 'findWordFreq' function gets the word count and the maximum number of alphabet used in the word distribution.

4 0
2 years ago
If a user wants to add an expansion card to increase the memory of a computer, where should the user insert the card?
uysha [10]

into a port on the outside of the computer


6 0
3 years ago
Read 2 more answers
Ontext clues can be used to determine the _____ of an unfamiliar word
Solnce55 [7]
Meaning of the word.

6 0
3 years ago
Other questions:
  • The magnavox odyssey was a commercial success
    13·1 answer
  • Who wants sum points? spam this and ill put 3 questions up for 100 points i have 7111 points rn
    7·2 answers
  • As with country citizenship, with digital citizenship comes _____.
    14·2 answers
  • A variation of pronounce is a. Proclaim c. Produce b. Profound d. Pronunciation Please select the best answer from the choices p
    11·1 answer
  • 2
    11·1 answer
  • A digital designer might do computer animation or video games true or false
    13·2 answers
  • Lucy has to move data from column A to column N in a worksheet. Which keys should she select to move data in the same worksheet?
    9·2 answers
  • What is malware? a type of virus that spreads through a network connection a type of virus that targets programs and files any p
    12·1 answer
  • The head of small organization wants to install a network so that all the employees of different department can share various re
    14·1 answer
  • I need help someone plz i need it fast ..........
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!