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
The FIFO method of computing equivalent units includes the beginning inventory costs in computing the cost per equivalent unit f
oksano4ka [1.4K]

Answer:

True

Explanation:

FIFO or first in first out is a system in business used to compute the equivalent costs per unit of inventory. The first product in the inventory, in FIFO, is the first product to be sold or opened for sales.

Although the cost of a unit separates the beginning inventory costs in computing the cost per equivalent unit from current production cost, it is for the current sales period of the first batch of inventory.

6 0
4 years ago
The Scientific Method is a/an
ser-zykov [4K]

Answer:

It's a method used in science to ask questions, research, observe, hypothesize, experiment, analyze data, and make conclusions.

Explanation:

5 0
3 years ago
Read 2 more answers
Machine language library routines are installed on computers Select one: a. because they can come as part of the operating syste
Licemer1 [7]

Answer:

c. all of these choices

Explanation:

all of them are correct. i took a quiz on this like 2 days ago and that was the answer.

<em>hope this helpsssssssss!!!!!!!!!!! :):):)</em>

6 0
4 years ago
Can someone please give me example of three types of loop in pascal (It has to has randomize in it too)
Lubov Fominskaja [6]

Sr.No Loop Type & Description
2 for-do loop Executes a sequence of statements multiple times and abbreviates the code that manages the loop variable.
3 repeat-until loop Like a while statement, except that it tests the condition at the end of the loop body. (HOPE THIS HELPS!!)
3 0
3 years ago
How do i make an Array in C++ Also how do i make it so i can Multithread on Java
DIA [1.3K]

Answer:

To start a thread we simply need to create a new thread object and pass the executing code to be called (i.e, a callable object) into the constructor of the object. Once the object is created a new thread is launched which will execute the code specified in callable. After defining callable, pass it to the constructor.

Explanation:

3 0
4 years ago
Other questions:
  • What is the need for using secondary memory devices?
    5·1 answer
  • How is a computer and a iphone different
    9·1 answer
  • You need to transmit PII via email and you want to maintain its confidentiality. Which of the following choices is the BEST solu
    8·1 answer
  • Write programs for two MSP430 boards to do the following:
    15·1 answer
  • Preparing for jobs that are high in demand allow you to...
    11·1 answer
  • To protect yourself from the risk of product failure, what strategy could you use?
    15·1 answer
  • Http://moomoo.io/?server=8:16:0
    6·2 answers
  • Write programs for money exchange. In these programs please:
    7·1 answer
  • In java complete a program that takes a weight in kilograms as input, converts the weight to pounds, and then outputs the weight
    15·1 answer
  • bookmark question for later what database did zach choose? microsoft excel microsoft access db2 oracle
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!