Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Java please help (Statistics: compute deviation) Programming Exercise 5.45 compu

ID: 645269 • Letter: J

Question

Java please help (Statistics: compute deviation) Programming Exercise 5.45 computes the standard deviation of numbers. This exercise uses a different but equivalent formula to compute the standard deviation of n numbers. To compute the standard deviation with this formula, you have to store the individual numbers using an array, so that they can be used after the mean is obtained. Your program should contain the following methods: Write a test program that prompts the user to enter ten numbers and displays the mean and standard deviation as shown in the following sample run:

Explanation / Answer

import java.util.Scanner; // Scanner is in the java.util package public class BasicStatisticsCalculator { static final int NUMBER_OF_ELEMENTS=6; static int[] numbers=new int[NUMBER_OF_ELEMENTS]; public static void main(String[] args) { do { switch(menu()) { case 'a': insertSeries(numbers); break; case 'b': mean(numbers); break; case 'c': median(numbers); break; case 'd': mode(numbers); break; case 'e': sd(numbers); break; case 'f': showSeries(numbers); break; case 'g': greaterThanMean(numbers); break; case 'h': smallerThanMean(numbers); break; case 'i': bubbleSort(numbers); break; case 'j': fullReport(numbers); break; case 'q': System.exit(0); } } while(true); } //Menu Display static char menu(){ Scanner input=new Scanner(System.in); System.out.println(" BASIC STATISTICS CALCULATOR"); System.out.println(" a. Insert Series"); System.out.println(" b. Mean"); System.out.println(" c. Median"); System.out.println(" d. Mode"); System.out.println(" e. Standard Deviation"); System.out.println(" f. Show Series"); System.out.println(" g. Show Elements greater than the mean"); System.out.println(" h. Show Elements smaller than the mean"); System.out.println(" i. Show series in order"); System.out.println(" j. Show Full Report"); System.out.println(" q. Quit"); System.out.print(" Insert option: "); return(input.next().charAt(0)); }//END menu display /*Insert series */ static void insertSeries(int[] numbers) { java.util.Scanner input = new java.util.Scanner(System.in); for (int i = 0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote