Question: 1. Download ComputeMeanDeviation.java from M5 Methods module in folio. 2. Modify the program by adding the following two methods: public static double mean (int


1. Download ComputeMeanDeviation.java from M5 Methods module in folio. 2. Modify the program by adding the following two methods: public static double mean (int boundary, int n) public static double deviation (int boundary, int n) In the mean method, generate n random integers = [0, boundary], compute and return the result of the mean. In the deviation method, generate n random integers = [0, boundary], compute and return the result of the standard deviation. The formulas to compute the mean and the standard deviation are: mean = i=1 n (x) deviation = i=1 n-1 n 3. Rewrite the main method so that it invokes the mean and deviation methods and displays the results of the mean and the standard deviation. A sample main method is as follows. Please type this main method in your own source code. public static void main(String[] args) { // Find mean double meanValue = mean (99, 1000); // Find standard deviation double deviationValue = deviation (99, 1000); // Display result. System.out.println("The mean is " + meanValue); System.out.println("The standard deviation is " + deviationValue); } package homework; import brandon.math. Random; import brandon.math.Math; public class HW4 { public static void main(String[] args) { } // Find mean double meanValue = mean (99, 1000); // Find standard deviation double deviationValue = deviation (99, 1000); // Display result " System.out.println("The mean is " + meanValue); System.out.println("The standard deviation is + deviationValue); public static double mean (int boundary, int n) { //Complete on your own } public static double deviation (int boundary, int n) { //Complete on your own } }
Step by Step Solution
3.23 Rating (164 Votes )
There are 3 Steps involved in it
The Mean method The mean method is used to calculate the average ... View full answer
Get step-by-step solutions from verified subject matter experts
