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
A site, a domain, or an organizational unit in active directory is referred to as a:____.
grandymaker [24]

A site, a domain, or an organizational unit in an active directory is referred to as a <u>container.</u>

<h3>What is a domain?</h3>

A domain is a name of a site of a name that is given online to a website. This name is the identity of the website. This gives the detail of your site, and your site will be identified by this name.

An active directory is a function developed by Microsoft. It maintains the network of a windows domain. This contains the site, domain, and together called a container.

Thus, a container in an active directory is a site, a domain, or an organizational unit.

To learn more about the domain, refer to the link:

brainly.com/question/17562152

#SPJ4

8 0
2 years ago
Which describes the first step a crawler-based search engine uses to find information?
Orlov [11]
<span>Crawler-based search engines are what most of us are familiar with - mainly because that's what Google and Bing are. These companies develop their own software that enables them to build and maintain searchable databases of web pages (the engine), and to organise those pages into the most valuable and pertinent way to the user.</span>
5 0
3 years ago
Read 2 more answers
What is the output of the following code?<br> print (12 // 6)
sveta [45]

Answer:

2

  • See here we have //
  • // means floor division in python.
  • It gives us only the integer part not floating or decimal.

So

12//6=2

8 0
2 years ago
The___is a waterproof fabric that is placed around your camera
Zina [86]
Can you help me with homework and the answer is a circle
5 0
3 years ago
Many company websites are now designed to do more than just sell a product. These​ websites, known as​ __________ websites, atte
Zinaida [17]

Answer:

brand community

Explanation:

Many company websites are now designed to do more than just sell a product. These​ websites, known as​ brand community websites, attempt to build closer customer relationships and generate engagement with and between the brand and its customers. These online communities bring together consumers who have shared interests in a brand or product. One advantage of online brand communities is that they reduce customer support costs as the business has more engagement with their customers.This also helps the business to retain customers through brand improvement centered around the customer's actual needs.

5 0
3 years ago
Other questions:
  • Which two sentences uses the colon correctly?
    13·1 answer
  • Write an expression to compute the quartic root of x. the quartic root of a number is the square root of its square root. exampl
    11·1 answer
  • If your internet were to go out, what steps would you take to troubleshoot to restore your service?
    15·1 answer
  • A microsoft windows os component responsible for representing graphical objects and transmitting them to output devices such as
    15·1 answer
  • Plz subscribe my yt gaming channel <br>FIREAZZ GAMING​
    8·2 answers
  • True or False The two types of general construction projects are residential for homes or dwellings and commercial for a commerc
    7·1 answer
  • In a PC, which of the following components stores the BIOS
    6·1 answer
  • Write a SELECT statement that returns one row for each musician that has orders with these columns:
    13·1 answer
  • What operating system do most users use?
    13·1 answer
  • Database queries is an example of
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!