Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions

Question

Define marketing concepts.

Answered: 1 week ago

Question

1 what does yellow colour on the map represent?

Answered: 1 week ago