Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Im having trouble getting my program to work. i keep getting an error when trying to include the mean into my standard deviaiton method. Write

Im having trouble getting my program to work. i keep getting an error when trying to include the mean into my standard deviaiton method.

Write a program that prompts the user for 10 floating point values. The program should invoke two methods to calculate the mean and standard deviation of the numbers. You can use the formula below to calculate the mean and standard deviations.

You will need:

A scanner object to read the 10 values

An array to store the ten values

Two methods that do the following:

Accepts an array and returns the mean

Accepts an array and returns the standard deviation

image text in transcribed

A sample of the output is shown below

Enter ten numbers: 1.9 2.5 3.7 2 1 6 3 4 5 2 The mean is 3.1100000000000003 The standard deviation is 1.5573838462127583

System. out. println the mean is mean (list2 System. out. println the standard deviation is SD (list2 public static double mean (double array) calculates mean and returns value double sum 0; for int i 0 i Karray length itt) sum array [i] return sum array length; public static double SD double array) calculates standard deviation double d 0 for (int i 0: i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

1489982175, 978-1489982179

Students also viewed these Databases questions

Question

then Tote Gaphics

Answered: 1 week ago

Question

=+ 9. What is inflation and what causes it?

Answered: 1 week ago

Question

=+6. What does the invisible hand of the marketplace do?

Answered: 1 week ago