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

Need help with this one: A program that analyzes a set of numbers can be very us

ID: 3657670 • Letter: N

Question

Need help with this one:

A program that analyzes a set of numbers can be very useful. Create an Analysis application that prompts the user for numbers in the range 1 through 50, terminated by a sentinel, and then performs the following analysis on the numbers: Determine the average number Determine the maximum number Determine the range (maximum - minimum) Determine the median (the number that occurs the most often) Displays a bar graph called a histogram that shows the numbers in each five-unit range (1-5, 6-10,11-15, etc.). The histogram may look similar to:

Explanation / Answer

/*you may also download the code from........http://www.2shared.com/file/Vqx7P22P/Numbers.html*/ import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.Scanner; public class Numbers { public static void main(String[] args) { ArrayList num = new ArrayList(); int temVal; int average; int maximun; int minimum; int median; String range; Scanner input = new Scanner(System.in); System.out .println("Enter the numbers in the range of 1 through 50 (-1 to exit)"); do { System.out.println("Enter the number:"); temVal = input.nextInt(); if (temVal != -1 && (temVal >= 1 && temVal