1. Download ComputeMeanDeviation.java from M5 Methods module in folio. 2. Modify the program by adding the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 } } 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 } }
Expert Answer:
Answer rating: 100% (QA)
The Mean method The mean method is used to calculate the average ... View the full answer
Related Book For
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates
Posted Date:
Students also viewed these programming questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
In which control account would you expect to find a provision for doubtful debts?
-
Why do noninvestment-grade bonds have much higher direct costs than investment-grade issues?
-
Which broad category of BI/analytics might Walmart employ to analyze the flow of shoppers through its stores? What might be the purpose of such an analysis? What broad category of BI/ analytics might...
-
How do you prevent name clashes when using header files?
-
The City of Faireld issued $100 million of 20-year, 6 percent coupon bonds (3 percent per semiannual period) for $89.32 million. The price reected a yield of 7 percent (3.5 percent period semiannual...
-
Why is the relational model more important above the other models?
-
What Happens When You Dont Deliver on Your Promises Web: www.clearly.ca Facebook: Clearly Canadian If a new product or service seems like the perfect option to solve a problem or capitalize on an...
-
a) b) c) Construct an Activity On Arrow AOA network based on the table Q3. The time is in weeks. Propose critical path and another TWO (2) possible paths other than critical path, with information on...
-
Prepare a 250 word (minimum) discussion of a "routed transaction" vs. a (standard) transaction. Be sure to identify what needs to be in place for each named transaction. What are the compliance...
-
If the sum of P15,000 is deposited in an account earning interest at the rate of 9% compound quarterly, what will it become at the end of 8 years?
-
A string is attached to a heavy wall, goes over an ideal pulley, and is then attached to a mass m. A second string continues to a second mass m as shown. a. What is the tension T_(1) in terms of m...
-
A solar thermal electric plant absorbs heat from a molten salt at 520 degrees Celcius and rejects heat to the environment at 300 K. What is its thermal efficiency if it is 25% of its Carnot...
-
[The following information applies to the questions displayed below.] On January 1, 2024, the general ledger of 3D Family Fireworks includes the following account balances: Accounts Cash Accounts...
-
The great global recession has claimed many victims. In many countries, unemployment is at near-historic highs, and even those who have managed to keep their jobs have often been asked to accept...
-
MgO prevents premature evaporation of Al in a furnace by maintaining the aluminum as Al2O3. Another type of matrix modifier prevents loss of signal from the atom X that readily forms the molecular...
-
A health-care issue that has been in the news lately is the computerization of health records. This possibility is being approached cautiously because of sensitive privacy and security concerns,...
-
What is the difference between the following pairs? a) Deadlockstarvation b) Waitsleep c) Concurrencyparallelism d) Readyrunnable e) NotifynotifyAll f) Waiting statetimed waiting state g) blockeddead.
-
Standard telephone keypads contain the digits zero through nine. The numbers two through nine each have three letters associated with them (Fig. 15.19). Many people find it difficult to memorize...
-
A candlestick chart is similar to a bar chart except that the candlestick chart: A. Represents upward movements in price with Xs. B. Also graphically shows the range of the periods highs and lows. C....
-
What considerations might encourage a market analyst to rely more on a top-down or bottom-up forecast of S&P 500 operating earnings?
-
Which of the following advantages listed by Ryan with respect to the earnings-based approach studied by Atkinson is most likely correct? The model A. Can be used for non-U.S. equity markets. B....
Study smarter with the SolutionInn App