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 build a machine that can create anything
jeka94

Answer:

by getting a good machine

5 0
3 years ago
A state of stress that occurs at a point on the free surface of the of a solid body is = 50 MPa σ x , =10 MPa σ y , and = −15 MP
posledela

Answer:

A) 5 MPa , 55 MPa

B) maximum stress = 55 MPa,  maximum shear stress = 25 MPa

Explanation:

using the given Data

free surface of a solid body

α_{x} = 50 MPa,    α_{y} = 10 MPa , t_{xy} = -15 MPa

attached below is the detailed solution to the question

7 0
4 years ago
Why/how is a paperclip able to float on water?
abruzzese [7]

Answer:

Water surface tension

Explanation:

The water around the paperclip forms a kind of elastic surface, deforming, in which the clip can stay afloat.

This is because the molecules that are on the surface of the water, already in contact with the air, try to cling to those that are next to them and those that are immediately below.

If we added even if it were just a drop of soap in the water, the clip would go to the bottom, because the soap has the ability to decrease the surface tension of the water.

7 0
3 years ago
What happens when the arms of the milky move away from the center of the galaxy
Alina [70]
Well this question is though because we have never seen such a thing ! and to be quite frank when that happens , nothing good comes from it. Black Holes
6 0
3 years ago
You can divide a surface by drawing a line through it
SpyIntel [72]

Answer:

T

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • The current source in the circuit below is given by i S (t) = 18 sin(35t +165) A. A. [6 points] Apply the phasor-domain analysis
    8·1 answer
  • Steam enters an adiabatic turbine at 8 MPa and 500°C at a rate of 18 kg/s, and exits at 0.2 MPa and 300°C. Determine the rate of
    7·1 answer
  • In a 1-phase UPS, Vd = 350 V, vo(t) = 170 sin(2π * 60t) V, and io(t) = 10 sin(2π * 60t - 30ᴼ) A.Calculate and plot da(t), db(t),
    14·1 answer
  • What is ONE DIFFERENCE between civil structural engineering
    13·1 answer
  • Consider a normal shock wave in air. The upstream conditions are given by M1=3, p1 = 1 atm, and r1 = 1.23 kg/m3. Calculate the d
    15·1 answer
  • I have a resistor connected to a power supply that delivers a fixed voltage for any current (up to some maximum current). With a
    8·1 answer
  • One of the best methods for understanding a company’s policies and procedures is
    14·1 answer
  • For each of the species below, identify any cyclic conjugated system, then: A. Determine the number of electrons in a system of
    7·1 answer
  • What is the primary reason that heating, ventilating, and air conditioning (HVAC) is critical to a data center
    8·1 answer
  • Find the resultant of the force system on the body OABC as shown .find the points where the resultant will cut the X and Y axis?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!