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
8. Describe and correct the error in stating the domain. Xf * (x) = 4x ^ (1/2) + 2 and g(x) = - 4x ^ (1/2) The domain of (f + g)
konstantin123 [22]

Answer:

hi

Explanation:

4 0
3 years ago
A mixture of air and methane is formed in the inlet manifold of a natural gas-fueled internal combustion engine. The mole fracti
german

Answer:

The mass flow rate of the mixture in the manifold is 6.654 kg/min

Explanation;

In this question, we are asked to calculate mass flow rate of the mixture in the manifold

Please check attachment for complete solution and step by step explanation.

4 0
3 years ago
A patient has swollen feet, ankles, and legs, and has pain in his lower back. Tests show the level of urea, a waste product, in
myrzilka [38]

Answer: B  Excretory

Explanation: Hope this helps :)

3 0
3 years ago
What i s the value of a capacitor with 250 V applied and has 500 pC of charge? (a) 200 uF (b) 0.5 pF (c) 500 uF (d) 2 pF
exis [7]

Answer:

(d) 2 pF

Explanation: the charge on capacitor is given by the expression

Q=CV

where Q=charge

           C=capacitance

           V=voltage across the plate of the capacitor

here we have given Q=500 pF, V=250 volt

using this formula C=\frac{Q}{V}

=500×10^{-12}×\frac{1}{250}

=2×10^{-12}

=2 pF

3 0
3 years ago
Plis 3 conclusiones de este video
vazorg [7]
No hay videos? de cual video estás hablando?
6 0
2 years ago
Other questions:
  • The displacement volume of an internal combustion engine is 2.2 liters. The processes within each cylinder of the engine are mod
    13·1 answer
  • Name two types of battery chargers that are used in mechanics
    14·1 answer
  • Takt time is the rate at which a factory must produce to satisfy the customer's demand. a)- True b)- False
    11·1 answer
  • Determine the resultant normal force across the cross section at point B. Express your answer to three significant figures and i
    6·1 answer
  • Selling a new vehicle pays a salesperson $1500. Selling a used vehicle pays a commission of 5% of the selling price. Write an in
    9·1 answer
  • If you owned a business, what are some of the ways you could follow green computing recommendations with regards to recycling an
    13·1 answer
  • What is the thermal efficiency of this reheat cycle in terms of enthalpies?
    11·1 answer
  • if you help then I will thank u by sooo much I will give tons of points but the answer has to be right.
    14·2 answers
  • Who plays blox burg???
    15·2 answers
  • Tech A says that a mechanical pressure regulator exhausts excess fluid back to the transmission pan. Tech B says that if the tra
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!