Question: Create an array ( of a user - defined size ) Populate the array with Random numbers in the range of 1 - 1 0
Create an array of a userdefined size
Populate the array with Random numbers in the range of inclusive
Output the original array twice.
SPECIFICATIONS:
The starter code has been provided for this lab.
File name: Arrayoutputvalues.java
The starter code does contain questions at the bottom that must be addressed
The starter code does contain formatting mistakes including outside the method that students must add code that must be addressed
The output must match the sample output exactly.
The user must be prompted for
a seed for the random number generator RNG and
the size of the array.
Any integer may be used as the seed to the random number generator
An array must be effectively used to accomplish the goal of the assignment to print twice a single array filled with random numbers otherwise, full credit will be deducted
ClassInstance variablesconstants may not be used. In general, content not formally presented in the class heretofore cannot be usedi
To receive full credit,
The constant called MAX must be declared atop the main method and effectively used in the program to generate random numbers from to inclusive. In general, avoid using 'magic numbers' in code because 'magic numbers' reduce codereadability. An integer constantivariable should not appear in the code except for possibly common integers, such as or
the main method must call the following three programmerdefined methods methods that you write
an input nonvoid method that uses a Scanner object declared in the main method but does not declare any variables within the method to return a Random object that will be used to create random integers in a different method
a process nonvoid method that uses a Scanner object, a Random object, and a constant declared and instantiated in the main method to return an array of random integers from to inclusive, and
an output void method that uses an array of random integers to display program results the contents of the array printed twice
the main method should only contain
the Scanner object and a primitive variable used to store the number of integers to store in the array declaration
the three method calls to the programmerdefined methods the methods that you write and
one method call to the Scanner object that does not read from the input bufferl
use the most appropriate loop to the array manipulation.
the only Scanner object must be declared in the main method; do not move the Scanner object declaration nor declare another Scanner object in the program.
the program must contain multiple programmerdefined methods the methods that you write that complete the major steps of the program, each method should be focused on a singular task, and have a comment that gives a description of the method purpose
every method should be preceded with a comment that includes a description of the method purpose and the value returned ff applicable Comments should also be included in the body of each method.
The program must properly function with any nonnegative array size including a size of
The code should be written efficiently to
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
