Homework Assignment #7. Assigned TUES APR 17, due TUE, APR 24 at 11:59 pm

The final is:

This problem is not hard. Please look at it as soon as possible. Familiarity with this problem will help you on the final.

Use the random number generator in a Java program to generate n random numbers between zero and ten in a method with the heading public static void generate(int n). The value of n should be defined in a final statement in the main method. Store each of these numbers in successive elements of an array x using a for loop and print the values. (The array x should, of course, have n elements and should be dimensioned in method generate by using new.) Then using another for loop in method generate, print these random numbers in the reverse order in which they were stored. Thus for example if the value of n is 4 and the numbers generated were 8, 7, 10, and 2, your program after printing 8, 7, 10, and 2 would print 2, 10, 7 and 8.

The assignment will focus on the use of Math.random(), for loops and arrays.