Question
Develop a program that allows students to know the mean, population variance, maximum, and minimum of three integer numbers between 0 and 100 inclusive.
Develop a program that allows students to know the mean, population variance, maximum, and minimum of three integer numbers between 0 and 100 inclusive. Name this program StatMenu.java. TODO: 1. Create a menu that prompts the student for the type of statistical problem they would like to solve. See the menu below. Welcome to the Math Program A. Maximum B. Minimum C. Mean D. Variance Enter your choice: 2. Next, using the Scanner class retrieves the letter of the menu choice that the student entered. a. Print an error message if the student does not enter A, B, C, or D. b. The program can/should simply end if the choice was invalid 3. Prompt students to enter a number of a proper type and use the Scanner class to retrieve the three numbers that the student entered; notice that each integer number should be between 0 and 100, inclusive. a. Print an error message if the number is larger than 100 or less than 0. a. Print an error message if the student does not enter A, B, C, or D. b. The program can/should simply end if the choice was invalid 3. Prompt students to enter a number of a proper type and use the Scanner class to retrieve the three numbers that the student entered; notice that each integer number should be between 0 and 100, inclusive. a. Print an error message if the number is larger than 100 or less than 0. b. Again, end the program if the user types something invalid. 4. Output the original input and the answer to the selected math problem. (The following are separate runs of the program): Welcome to the Math Program A. Maximum B. Minimum C. Mean D. Variance Enter your choice: C Enter three numbers: 9, 60, 27 The mean of (9, 60, 27) is: 32.00 Welcome to the Math Program A. Maximum B. Minimum C. Mean D. Variance Enter your choice: A Enter three numbers: 4, 79, 10 The maximum of (4, 79, 10) is: 79.00 Notes: Don't forget to import java.util.Scanner; For Steps #2 and #3 -- you do not have to reprompt the user if the information they enter is invalid. You can simply print an error message and end the program (suggestion: use System.exit (0)). To calculate the mean of 3 integers: x+x+x 3 o double mean = To calculate the population variance of 3 integers: (x,-mean) + (x-mean) + (x, - mean) variance = 3 Print all results to 2 decimal places (including the max and min)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
a Java program named StatMenujava that allows students to calculate the mean population variance max...Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started