Question
1. Create a class named doubleMe and complete the following tasks: a. Create a scanner that will get user entries. b. Ask the user how
1. Create a class named doubleMe and complete the following tasks:
a. Create a scanner that will get user entries.
b. Ask the user how many integers they will enter and store their answer into a variable named num.
c. Declare an array named arr that can hold the number of integers the user chose.
d. Write a for-loop using the length of arr to ask the user to enter their integers, store each into the array.
e. Write a 2nd for-loop to print the array of user integers, output should look like: numbers = {2,5,3,1}
f. Write a 3rd for-loop to double each number in the array as it traverses the array.
g. Write a 4th for-loop that prints the new array, output should now look like: new numbers = {4,10,6,2}
The code is Java
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