Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

public static void computeSD (int [ ] numbers) { int length = numbers.length; double var, sd, mean, sum, varsum; sum = 0; for (int i

public static void computeSD (int [ ] numbers)

{

int length = numbers.length;

double var, sd, mean, sum, varsum;

sum = 0;

for (int i = 0; i < length; i++)

{

sum += numbers [ i ];

}

mean = sum / (double) length;

varsum = 0;

for (int i = 0; i < length; i++)

{

varsum = varsum + ((numbers [ i ] - mean) * (numbers [ i ] - mean));

}

var = varsum / ( length - 1.0 );

sd = Math.sqrt ( var );

System.out.println ("standard deviation: " + sd);

}

Provide test inputs and expected outputs for each test path you list. If it is not possible to find the test input for certain test path, describe the reason. (2 pts.)

Hint: Not providing expected outputs will get 1 point deduction. Not matching test paths with their corresponding input/output will get 1 point deduction

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

Database Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

More Books

Students also viewed these Databases questions

Question

Explain how digital documents have special design requirements

Answered: 1 week ago