Question: In JAVA, Create an array of size 20 and assign a random number between 1 and 100 to each position. Next, use a loop to
In JAVA, Create an array of size 20 and assign a random number between 1 and 100 to each position.
Next, use a loop to print all of the number separated by commas. You will get a comma after the last value of the array. Try to figure out how to NOT make this happen. Why would you put a comma after the last value printed?
Next, use a loop to help determine and then print the average of all of the numbers.
Next, print a list of all the numbers that are greater than the average.
Next, print a list of the number that are divisible by 3.
Use JOptionPane() windows for your output. NO importing scanners
So a sample run would be...
Array is... 56, 12, 78, 95, 23, 67, 12, 66, 11, 10, 34, 56, 78, 45, 76, 90, 100, 2, 6, 87
The average is 50.2
Numbers greater than the average are... 56, 78, 95, 67, 66, 56, 78, 76, 90, 100, 87
The numbers divisible by 3 are... 12, 78, 12, 66, 78, 45, 90, 6, 87
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
