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
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