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
HW6P2 (20 points) The recorded daily temperature (°F) in New York City and in Denver, Colorado during the month of January 2014
Maurinko [17]

Answer & Explanation:

function Temprature

NYC=[33 33 18 29 40 55 19 22 32 37 58 54 51 52 45 41 45 39 36 45 33 18 19 19 28 34 44 21 23 30 39];

DEN=[39 48 61 39 14 37 43 38 46 39 55 46 46 39 54 45 52 52 62 45 62 40 25 57 60 57 20 32 50 48 28];

%AVERAGE CALCULATION AND ROUND TO NEAREST INT

avgNYC=round(mean(NYC));

avgDEN=round(mean(DEN));

fprintf('\nThe average temperature for the month of January in New York city is %g (F)',avgNYC);

fprintf('\nThe average temperature for the month of January in Denvar is %g (F)',avgDEN);

%part B

count=1;

NNYC=0;

NDEN=0;

while count<=length(NYC)

   if NYC(count)>avgNYC

       NNYC=NNYC+1;

   end

   if DEN(count)>avgDEN

        NDEN=NDEN+1;

   end

   count=count+1;

end

fprintf('\nDuring %g days, the temprature in New York city was above the average',NNYC);

fprintf('\nDuring %g days, the temprature in Denvar was above the average',NDEN);

%part C

count=1;

highDen=0;

while count<=length(NYC)

   if NYC(count)>DEN(count)

       highDen=highDen+1;

   end

   count=count+1;

end

fprintf('\nDuring %g days, the temprature in Denver was higher than the temprature in New York city.\n',highDen);

end

%output

check the attachment for additional Information

8 0
3 years ago
A clean machine is a _______________ machine.
solniwko [45]
A clean machine is a clean machine :-)
4 0
3 years ago
The component of a regenerative vapor power cycle that permits only liquid to pass through to a region of lower pressure is a?
Zepler [3.9K]

The component of a regenerative vapor power cycle that permits only liquid to pass through to a region of lower pressure is a Valve/trap.

<h3>What is vapor?</h3>
  • In physics, a substance in the gas phase at a temperature lower than its critical temperature is referred to as a vapor or vapor.
  • This means that the vapor can be condensed to a liquid by increasing the pressure on it without decreasing the temperature.
  • An aerosol is distinct from a vapor.
  • A suspension of minute liquid, solid, or both types of particles in a gas is known as an aerosol.
<h3>Why does vapor form?</h3>
  • Evaporation or sublimation are two processes that can be used to create it.
  • Unlike clouds, fog, or mist, which are only suspended drops of liquid water in the atmosphere, watevaporur is a gas and cannot be seen.
  • In the atmosphere, water vapor frequently exists below the boiling point.

Learn more about vapor here:

brainly.com/question/14578189

#SPJ4

3 0
2 years ago
A material has the following properties: Sut = 275 MPa and n = 0.40. Calculate its strength coefficient, K.
Tems11 [23]

Answer:

The strength coefficient is K = 591.87 MPa

Explanation:

We can calculate the strength coefficient using the equation that relates the tensile strength with the strain hardening index given by

S_{ut}=K \left(\cfrac ne \right)^n

where Sut is the tensile strength, K is the strength coefficient we need to find and n is the strain hardening index.

Solving for strength coefficient

From the strain hardening equation we can solve for K

K = \cfrac{S_{ut}}{\left(\cfrac ne \right)^n}

And we can replace values

K = \cfrac{275}{\left(\cfrac {0.4}e \right)^{0.4}}\\K=591.87

Thus we get that the strength coefficient is K = 591.87 MPa

6 0
3 years ago
A world class runner can run long distances at a pace of 15 km/hour. That runner expends 800 kilocalories of energy per hour. a)
maks197457 [2]

Answer: a) 1.05kW b) 3.78MJ c) 5.3 bars

Explanation :

A)

Conversions give 900 kcal as 900000 x 4.2 J/cal {4.2 J/cal is the standard factor}

= 3780kJ

And 1 hour = 3600s

Therefore, Power in watts = 3780/3600 = 1.05kW = 1050W

B)

At 15km/hour a 15km run takes 1 hour.

1 hour is 3600s and the runner burns 1050 joule per second.

Energy used in 1 hour = 3600 x 1050 J/s

= 3780000 J or 3.78MJ

C)

1 mile = 1.61km so 13.1 mile is 13.1 x 1.61 = 21.1km

15km needs 3.78 MJ of energy therefore 21.1km needs 3.78 x 21.1/15 = 5.32MJ =5320 kJ

Finally,

1 Milky Way = 240000 calories = 4.2 x 240000 J = 1008000J or 1008kJ

This means that the runner needs 5320/1008 = 5.3 bars

7 0
3 years ago
Other questions:
  • A converging-diverging nozzle is designed to operate with an exit Mach number of 1.75 . The nozzle is supplied from an air reser
    15·1 answer
  • Air is compressed adiabatically from p1 1 bar, T1 300 K to p2 15 bar, v2 0.1227 m3 /kg. The air is then cooled at constant volum
    13·1 answer
  • I am trying to create a line of code to calculate distance between two points. (distance=[tex]\sqrt{ (x2-x1)^2+(y2-y1)^2}) My li
    5·1 answer
  • What is the maximum number of 12-2 with ground nonmetallic-sheathed cables permitted in an 18-cubic-inch device box if two singl
    11·2 answers
  • If you know that the change in entropy of a system where heat was added is 12 J/K, and that the temperature of the system is 250
    10·1 answer
  • Torque is a twisting force. If the required torque applied on a 3 ft wrench is 45 ft·lb, what is the force that must be applied?
    5·1 answer
  • WARNING:<br><br> when people put links in the answer it is a virus DO NOT DOWNLOAD IT
    15·2 answers
  • Prelest! Introduction to Engineering and Technology 1 Select the correct answer. What technological invention allowed for the pr
    5·1 answer
  • Travel Planning or Destination Planning will help make your travel more efficient, and not necessary a risk reduction plan as yo
    10·2 answers
  • Design an algorithm for computing √n
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!