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
How to calculate tension.
Evgen [1.6K]

Answer:

Tension can be easily explained in the case of bodies hung from chain, cable, string

Explanation

uniform speed, tension; T = W.

T=m(g±a)

3 0
2 years ago
List the four processes in the Otto cycle.
OleMash [197]

Answer:

Explanation:

A woman walks due west on the deck of a ship at 3 miyh.The ship is moving north at a speed of 22 miyh.Find the speed and direction of the woman relative to the surface of the water.

7 0
3 years ago
A safety interlock module operates by monitoring the voltage from the
In-s [12.5K]

Answer: its an Ignition coil

8 0
3 years ago
Tech A states that friction brakes lose energy as heat. Tech B states that a brake-by-wire system converts this energy into usef
hjlf
Tech A.......................
4 0
2 years ago
Why would an aerospace engineer limit the maximum angle of deflection of the control surfaces?
WITCHER [35]

Answer:

You can create high drag which allows a steeper angle without increasing your air speed on landing. you can reduce the length of landing role. Flaps are also used to increase the drag they are retracted when they are not needed. it is adviseable to down he flaps during the time of take off.

4 0
2 years ago
Other questions:
  • A hanging wire made of an alloy of nickel with diameter 0.19 cm is initially 2.8 m long. When a 59 kg mass is hung from it, the
    15·1 answer
  • Determine the total condensation rate of water vapor onto the front surface of a vertical plate that is 10 mm high and 1 m in th
    8·2 answers
  • 5
    15·1 answer
  • I need this asap thank you :) plzzzzz When the spring on a mousetrap car is fully unwound, the force acting on the car is _____.
    11·1 answer
  • what is an example of an innovative solution to an engineering problem? Explain briefly why you chose this answer.
    14·1 answer
  • What must engineers keep in mind so that their solutions will be appropriate?
    15·1 answer
  • ____________ is the organization that oversees environmental compliance.
    14·1 answer
  • 6) Describe the differences between the troposphere and stratosphere.
    14·1 answer
  • What is the difference between class 1 and class 3 lever?
    8·2 answers
  • assuming complementary inputs are available, the minimum number of transistors needed to realize a two input xor gate is:
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!