Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David M. Kroenke, David Auer

11th Edition

B003Y7CIBU, 978-0132302678

More Books

Students also viewed these Databases questions