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
stiv31 [10]
3 years ago
8

Modify the statistics program from this chapter so that client programshave more flexibility in computing the mean and/ or stand

ard deviation.Specifically, redesign the library to have the following functions:mean(nums) Returns the mean of numbers in nums.stdDev(nums) Returns the standard deviation of nums.meanStdDev (nums) Returns both the mean and standard deviation of nums.
Computers and Technology
1 answer:
vampirchik [111]3 years ago
8 0

Answer and Explanation:

Using Javascript:

function mean(nums){

var array_numbers= new array(nums);

var meanofNums= array_numbers.reduce()/array_numbers.length;

Console.log(meanofNums);

}

Function Std(nums){

var OurArray= new Array(nums);

var meanOfnums= mean(nums);

var i;

for(i=0; i<=OurArray.length; i++){

OurArray[i]= OurArray[i]-meanOfnums*OurArray[i]-meanOfnums;

}

var al_stdOfnums= OurArray.reduce()/OurArray.length;

var stdOfnums= Math. sqrt(al_stdOfnums);

Console.log(stdOfnums);

}

function meanStdDev (nums){

mean(nums);

Std(nums);

}

/*From the code above, we have defined functions and used them in the last function definition meanStdDev (nums), making for code reusability. In defining the functions, we have followed the formulas for calculating mean and standard deviations and implemented in that order. Notice how we used a for loop in std(nums) function definition to iterate through the elements of the array nums, squaring each value and reassigning a new value for each element(using index value) in the array. We then added these values in array using reduce method, dividing by array length and square rooting the value using the math object method sqrt().*/

You might be interested in
To enter a blank line into a document, press the ____ key without typing any text on the line.
Brilliant_brown [7]
You click the "enter" key found on the right side of most keyboards
7 0
3 years ago
Which of the following are addressed by programing design? Choose all that apply.
Viktor [21]

Answer:

Its B, D, and E

Explanation:

Hope this helps

6 0
3 years ago
Read 2 more answers
__________ is software that comes hidden in free downloadable software that tracks online movements, mines the information store
denis23 [38]

Answer:

Spyware

Explanation:

Spyware is the software which is used to track the online movements, it also track the user action on the computer they are also called sneakware  or stealthware

  • This software is used  in the business purpose which it may be used in the office to track the record of employee in the working hours .
  • Spyware  software is used to track the information without knowing the user.

 

7 0
3 years ago
236. A system such as a printer, smart TV, or HVAC controller, typically uses an operating system on what is called a:
irakobra [83]

Answer:

Embedded System

5 0
2 years ago
Read 2 more answers
Which situation best describes the prosumer effect?
elena-s [515]

C

Explanation:

https://www.sciencedirect.com/science/article/pii/S2405844019356750

8 0
4 years ago
Other questions:
  • A new company will have 40 workstations in one building sharing a single network. All users must be able to share files and prin
    9·1 answer
  • Which tag provides information about a web site?
    12·1 answer
  • With that ------ outlook he doesn't trust anyone.
    11·1 answer
  • An intruder with malicious intent breaks into an office and steals a hard drive containing sensitive information about the compa
    12·1 answer
  • What does the computer receive when you press a key on a laptop keyboard?
    8·1 answer
  • Unit: Advanced Productivity Applications This activity will help you meet these educational goals: Content Knowledge—You will us
    8·1 answer
  • The key uniquely identifies each record
    9·1 answer
  • When an item in a menu is black, it means that _____.
    7·1 answer
  • Your connection to this site is not secure how to fix.
    15·1 answer
  • Following rules of compaction, the IPv6 address 2001:0db8:0000:0000:0000:ff00:0012:3456 could also be written as _______.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!