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
A standard penetration test has been conducted on a coarse sand at a depth of 16 ft below the ground surface. The blow counts ob
scoray [572]

Solution :

Given :

The number of blows is given as :

0 - 6 inch = 4 blows

6 - 12 inch = 6 blows

12 - 18 inch = 6 blows

The vertical effective stress $=1500 \ lb/ft^2$

                                              $= 71.82 \ kN/m^2$

                                             $ \sim 72 \ kN/m^2 $

Now,

$N_1=N_0 \left(\frac{350}{\bar{\sigma}+70} \right)$

$N_1 = $ corrected N - value of overburden

$\bar{\sigma}=$ effective stress at level of test

0 - 6 inch, $N_1=4 \left(\frac{350}{72+70} \right)$

                      = 9.86

6 - 12 inch, $N_1=6 \left(\frac{350}{72+70} \right) $

                        = 14.8

12 - 18 inch, $N_1=6 \left(\frac{350}{72+70} \right) $

                         = 14.8

$N_{avg}=\frac{9.86+14.8+14.8}{3}$

       = 13.14

       = 13

8 0
2 years ago
Refrigerant-134a at 400 psia has a specific volume of 0.1144 ft3/lbm. Determine the temperature of the refrigerant based on (a)
vekshin1

Answer:

a) Using Ideal gas Equation, T = 434.98°R = 435°R

b) Using Van Der Waal's Equation, T = 637.32°R = 637°R

c) T obtained from the refrigerant tables at P = 400 psia and v = 0.1144 ft³/lbm is T = 559.67°R = 560°R

Explanation:

a) Ideal gas Equation

PV = mRT

T = PV/mR

P = pressure = 400 psia

V/m = specific volume = 0.1144 ft³/lbm

R = gas constant = 0.1052 psia.ft³/lbm.°R

T = 400 × 0.1144/0.1052 = 434.98 °R

b) Van Der Waal's Equation

T = (1/R) (P + (a/v²)) (v - b)

a = Van Der Waal's constant = (27R²(T꜀ᵣ)²)/(64P꜀ᵣ)

R = 0.1052 psia.ft³/lbm.°R

T꜀ᵣ = critical temperature for refrigerant-134a (from the refrigerant tables) = 673.6°R

P꜀ᵣ = critical pressure for refrigerant-134a (from the refrigerant tables) = 588.7 psia

a = (27 × 0.1052² × 673.6²)/(64 × 588.7)

a = 3.596 ft⁶.psia/lbm²

b = (RT꜀ᵣ)/8P꜀ᵣ

b = (0.1052 × 673.6)/(8 × 588.7) = 0.01504 ft³/lbm

T = (1/0.1052) (400 + (3.596/0.1144²) (0.1144 - 0.01504) = 637.32°R

c) The temperature for the refrigerant-134a as obtained from the refrigerant tables at P = 400 psia and v = 0.1144 ft³/lbm is

T = 100°F = 559.67°R

7 0
3 years ago
Explain by Research how a basic generator works ? using diagram<br>​
natulia [17]
Correcto no se muy bien de que se trata el tema porque está en inglés.
Sorry
8 0
2 years ago
What makes building an airplane while flying so difficult?
Naddik [55]

Answer: Because if something goes wrong while you are flying it it will crash

Explanation:

7 0
2 years ago
Which is a feedback mechanism for a system?
stira [4]

The following is a feedback mechanism for a system :

<u>The progress bar when downloading a file on iTunes</u>

<u></u>

Explanation:

  • A feedback mechanism is a loop system wherein the system responds to a perturbation. The response may be in the same direction (as in positive feedback) or in the opposite direction (as in negative feedback).
  • Feedback occurs when outputs of a system are routed back as inputs as part of a chain of cause-and-effect that forms a circuit or loop. The system can then be said to feed back into itself.
  • Evaluation feedback needs to be done “in the moment” to help the person receiving the feedback know where they stand.
  • A feedback control system consists of five basic components: (1) input, (2) process being controlled, (3) output, (4) sensing elements, and (5) controller and actuating devices.
  • Because negative feedback produces stable circuit responses, improves stability and increases the operating bandwidth of a given system, the majority of all control and feedback systems is degenerative reducing the effects of the gain.

6 0
3 years ago
Other questions:
  • Main technologies used in atms vending machines game consoles and microwave ovens
    6·1 answer
  • Two infinite extent current sheets exist at z = −3.0 m and at z = +3.0 m. The top sheet has a uniform current
    11·1 answer
  • If x &lt; 5 and x &gt;c, give a value of c such that there
    9·1 answer
  • 1 2 3 4 5 6 7 8 9 10
    14·1 answer
  • Set up the following characteristic equations in the form suited to Evanss root-locus method. Give L(s), a(s), and b(s) and the
    8·1 answer
  • You are an engineer working in a auto crash test lab. Some members of your team have raised objections against the use of cadave
    10·1 answer
  • Write a script (Program 2) to perform t he following matrix operations. Use output commands to clearly output each problem with
    15·1 answer
  • Name the famous engineer in the world​
    10·2 answers
  • What is the measurement below?
    12·1 answer
  • Yeah this question might be difficult as most of the brainly community is math. Hope I can find at last one robotics person. ;-;
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!