Question: You will create a Java program that does the following: 1) Create a Scanner to read user input 2) Create an array that can hold

You will create a Java program that does the following:

1) Create a Scanner to read user input

2) Create an array that can hold 5 integers

3) Use a for loop and the Scanner to collect 5 integers from the user

4) Write a for loop to print all the odd numbers the user entered on a single line

5) Write a for loop to print all the even numbers the user entered on a single line

6) Write a for loop to print all the numbers in reverse order. If the user entered 1, 2, 3, 4, and 5 the outpu twould be 5 4 3 2 1

7) Write a for loop to print the square root of all the numbers

8) Write a for loop to print all the numbers on one line with a bracket at the beginning and one at the end with each number separated by a space. If the user entered 1, 2, 3, 4, and 5 the output would be [12345]

9) Write a for loop to print the square of every number entered

10)Close the Scanner

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!