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
Veseljchak [2.6K]
3 years ago
12

Exercise 5.46 computes the standard deviation of numbers. This exercise uses a different but equivalent formula to compute the s

tandard deviation of n numbers. To compute the standard deviation with this formula, you have to store the individual numbers using a list, so that they can be used after the mean is obtained. Your program should contain the following functions:
Compute the standard deviation of values def deviation(x) Compute the mean of a list of values def mean (x) write a test program that prompts the user to enter a list of numbers and displays the mean and standard deviation, as shown in the following sample run Programming Exercises 351 Enter numbers: 1.9 2.5 3.7 2 1 6 3 4 5 2 FEner The mean is 3.11 The standard deviation is 1.55738
Engineering
1 answer:
ruslelena [56]3 years ago
4 0

Answer:

// This program is written in Java Programming Language

// Comments are used for explanatory purpose

// Program starts here

import java.util.Scanner;

public class STDeviation {

// Declare and Initialise size of Numbers to be 10

int Numsize = 10;

public static void main(String args [] ) {

Scanner scnr = new Scanner(System.in);

// Declare digits as double

double[] digits = new double[Numsize];

System.out.print("Enter " + Numsize + " digits: ");

// Input digits using iteration

for (int i = 0; i < digits.length; i++)

{

digits[i] = scnr.nextDouble();

}

// Calculate and Print Mean/Average

System.out.print("Average: " + mean(digits)+'\n');

// Calculate and Print Standard Deviation

System.out.println("Standard Deviation: " + deviation(digits));

}

// Standard Deviation Module

public static double deviation(double[] x) {

double mean = mean(x);

// Declare and Initialise deviation to 0

double deviation = 0;

// Calculate deviation

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

deviation += Math.pow(x[i] - mean, 2);

}

// Calculate length

int len = x.length - 1;

return Math.sqrt(deviation / len);

}

// Mean Module

public static double mean(double[] x) {

// Declare and Initialise total to 0

double total = 0;

// Calculate total

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

total += x[i];

}

// Calculate length

int len = x.length;

// Mean = total/length

return total / len;

}

}

You might be interested in
The simple majority decision rule may generate results that are
Arisa [49]

Answer:

Efficient when the marginal benefits of project = marginal costs of project.

Explanation:

Majority Decision Rule:

Majority decision rule is based on the notion of equality. An alternative is selected which has majority of votes. The simple majority decision rule may generate efficient results if the marginal benefits of a project are equal or greater than the marginal costs of the project.

5 0
3 years ago
Cars going straight or turning right have the right-of-way before you when you're making this type of turn
Paladinen [302]

Answer:

Yes. YES yes yes. Unless you are in Australia or something.

4 0
3 years ago
Answer?...................
torisob [31]

Answer:

The correct option is;

c. Leaving the chuck key in the drill chuck

Explanation:

A Common safety issues with a drill press leaving the chuck key in the drill chuck

It is required that, before turning the drill press power on, ensure that chuck key is removed from the chuck. A self ejecting chuck key reduces the likelihood of the chuck key being accidentally left in the chuck.

It is also required to ensure that the switch is in the OFF position before turning plugging in the power cable

Be sure that the chuck key is removed from the chuck before turning on the power. Using a self-ejecting chuck key is a good way of insuring that the key is not left in the chuck accidentally. Also to avoid accidental starting, make sure the switch is in the OFF position before plugging in the cord. Always disconnect the drill from the power source when making repairs.

5 0
3 years ago
What type of car engine is best for cold weather.
Komok [63]

Answer:Antifreeze/coolant

Explanation: keeps your engine cool in warm weather and keeps it from freezing up in the winter. A 50-50 mix of full strength coolant and water generally protects to around -30 degrees Fahrenheit. Make sure you check with the supplier or your owner's manual for the correct formulation

5 0
3 years ago
Why is it important to keep hand tools free of oil and grease?
Bezzdna [24]

Answer:

keeps it from rusting

Explanation:

5 0
3 years ago
Other questions:
  • What is A roofed structure that is similar to a porch, but is detached from the house.
    6·2 answers
  • Laws that protect businesses involve
    10·1 answer
  • What are the two safety precautions taken before driving a car​
    12·1 answer
  • Block A has a weight of 8 lb. and block B has a weight of 6 lb. They rest on a surface for which the coefficient of kinetic fric
    8·1 answer
  • Compact fluorescent bulbs are much more efficient at producing light than are ordinary incandescent bulbs. They initially cost m
    11·1 answer
  • Pennfoster Trades Safety test. Would appreciate the help. Thank you in advance. Check the screenshots below for the questions I'
    8·1 answer
  • A piston-cylinder apparatus has a piston of mass 2kg and diameterof
    12·1 answer
  • Showing or hiding records in a database is called “filtering.”<br> True<br> False
    8·2 answers
  • Explain what the engineering team should advise in the following scenario.
    7·1 answer
  • As you have learned, not all motor oils are the same. What are two things that make them different?.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!