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
Good business ethics is a good marketing strategy. Discuss
Arada [10]
Good business ethics are the key to good marketing and success. Ethics portray whether an individual has good judgment, intelligence, and many more things that are essential to business. Without good ethics business as a whole would be ruthless. Some business ethics are even required by the law in some places and there are rules and regulation to trade. 

Hope that answered your question!
6 0
3 years ago
Give a big-O estimate for the number of comparisons used by the algorithm that determines the number of 1s in a bit string of le
Illusion [34]
The notation would be O (n-1) because there would be no need to compare with the first bit however this notation is most commonly noted as O (n) but the first is also technically correct
3 0
3 years ago
Read 2 more answers
[c++] Write a recursive function takes a word string as input argument and reverse the word. Print out the results of recursive
Aleks04 [339]
I will try to give you the best answer I can possibly come up with. 
The easy way to get it is to store it into an array of strings and print the array of string backwards. You can do that by starting at the last part of the array down to the first letter.
3 0
3 years ago
Which type of account is required to utilize the Office Presentation Service?
sergejj [24]

Answer:

D. a Microsoft Account

Explanation:

You can deliver a document from Word using the Office Presentation Service, a free, public service that allows others to follow along in their web browser. No setup is required. Use your free Microsoft account to get started.

It Is Called Powerpoint

5 0
2 years ago
Read 2 more answers
A ________ record is a resource record that allows other servers to deliver Internet mail using SMTP.
Novay_Z [31]

The resource record that allows other servers to deliver Internet mail using SMTP is called; Mail Exchanger (MX)

<h3>Use of Mail Exchanger </h3>

The correct answer to the blank part of the question is "Mail Exchanger(MX)". This is because a mail exchanger record is simply an MX record that identifies the mail server that has the responsibility of accepting email messages on behalf of a domain name.

Now this Mail Exchanger also operates by allowing other servers to deliver Internet mail with the aid of SMTP(Simple mail transfer protocol)

Read more about SMTP at; brainly.com/question/14568877

4 0
2 years ago
Other questions:
  • What is a nonlinear presentation
    9·2 answers
  • On a vehicle with a manual transmission, a frequent mistake is shifting
    11·1 answer
  • The ____ tool allows a user to connect to the active registry database and make changes that are effective immediately. editreg.
    12·1 answer
  • . char values are surrounded by _____ quotes
    15·1 answer
  • When using the Common Internet File System (CIFS), which security model does not require a password to be set for the file share
    7·1 answer
  • Which of the following is the correct financial function that returns the periodic payment for a loan?
    10·1 answer
  • If your pulse is higher than your Target Heart Rate during exercise, what should you do?
    5·2 answers
  • A single-user/single-tasking operating system allows only one user to perform one task at a time. A real-time operating system g
    13·1 answer
  • What is the best way of farming exotics in destiny?
    12·2 answers
  • Fiona was talking to her colleagues about how advancements in digital technology had a negative effect on her life. Which aspect
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!