Cop2551 intro to oop homework - calculate the median value


Intro to OOP Homework -

Purpose - Practice using random numbers and arrays in a Java program.

Instructions - Create a Java program that performs the following tasks:

1. Create two arrays to store 24 and 25 random integers, respectively.

2. Generate integers using the java.util.Random class and store the numbers in both arrays.

A. Use a constant seed value to ensure the same results occur every time.

B. The range of the random numbers should be between 0 and 1000.

C. Both arrays will contain the exact same numbers (one less for the size 24 array).

3. Calculate the median value of the numbers stored in each array.

A. Sort the array.

B. Determine the middle value of the array.

1. Odd number of values, locate the middle value.

2. Even number of values, take the average of the middle two values.

4. Display the median value and the numbers store in both arrays (see Example Output section).

A. Display the array values using 10 columns.

Notes

Display homework number and programmer's name at top of program output.

Ensure source code comments conform to class commenting standards.

Ensure program development conforms to class programming standards.

Submit the project source code as a single *.java file.

Submit a text capture of the compiler results as a *.txt file.

Submit a text capture of the program output as a *.txt file.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Cop2551 intro to oop homework - calculate the median value
Reference No:- TGS02765628

Now Priced at $20 (50% Discount)

Recommended (96%)

Rated (4.8/5)