Question
Write a Java program to read n positive integers from an array and graph the information in the form of a bar chart or a
Write a Java program to read n positive integers from an array and graph the information in the form of a bar chart or a histogram-each number is printed, and then a number consisting of that many asterisks is printed beside the number. Have a method to fill the array with random numbers: the elements of the array should be random integers between 1 and 15. Also, have a method to print the array and another method to print the histogram, as in the sample output below. Work with dynamic arrays (ask the user to input the size of the array) and make sure you validate the input
Sample output: Do you want to start (Y/N) y Enter array size: 12 The array elements are 8 8 10 6 9 2 8 7 10 12 10 8 Histogram Index Value 12 10 Do you want to continue (Y/N) y Enter array size: 15Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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