Using Eclipse, create two classes: When you create the Main class (tester) click
ID: 3534178 • Letter: U
Question
Using Eclipse, create two classes: When you create the Main class (tester) click the box to include the static main method. The second class is called Stats, and will not have a main method. In Stats, implement two methods with the following signatures:
public double mean(double [ ] x)
This method should return the mean of the numbers in the x array. The formula is:Using Eclipse, create two classes: When you create the Main class (tester) click the box to include the static main method. The second class is called Stats, and will not have a main method. In Stats, implement two methods with the following signatures:
public double mean(double [ ] x)
This method should return the mean of the numbers in the x array. The formula is:
The second method has the following signature:
public double stdev(double [ ] x)
This method should return the standard deviation of the numbers in the x array. The formula is:
Back to the Main class. The main method should create an instance of Stats, and then call on its methods above as needed for testing. Further, the main method should prompt the user to enter a sequence of numbers, each separated by space or new line, until the user enters a blank (empty) new line. Hint: To check for empty new line, check for null first, and then zero-length string. Check out the Scanner class for how to read user input. Then it should print out the following:
The mean is ???.??? and the standard deviation is ??.???. [where the ??? are your results. Check out the System.out.printf method for formatting.]
The is should ask the user to enter 'y' or 'n' on whether to do it again.
Explanation / Answer
when do you need this by?
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.