Question

Java 1. Create a 1D array of 4096 Unique random integer numbers of 1 to 5...

Java

1. Create a 1D array of 4096 Unique random integer numbers of 1 to 5 digits. Of those numbers give me the following information:

- Mean , Mode, Median, Range.

- Five times, ask the user for a number within the range (from above) and record the time to find the number in the range. (Loop count)

2. Using a any sort algorithm, build sorted 2D array of random numbers (1 TO 5 digits ) with the x direction Unique numbers ant 4096 in size. The y or z direction recording the Mode for each number when random() produces a duplicate. (Collision).

-For the first row of the 2D array: Mean, Mode, Median, Range.

-Five times, ask the user for a number within the range (from above) and record the time to find the number. (Loop count)

3. Store data to a file

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1import java.io.File; 2 import java.io.FileNotFoundException; 3 import java.io.FileOutputStream; 4 import java.io.PrintStream210 // Writing it to the File PrintStream out-new PrintStream(new FileOutputStream(output.txt)); System.setout (out); Syste80 for (int í = 0; ǐ < array.length; ++İ) { int count = 0; for (int j- 0; j < array.length; ++j) if (array [j]array[i]) ++cou

119 120 public static int search(int [] array,int num) 121 122 123 124 125 for(int i 0;i<array.length-1;i++)\ if(array[i]num)

The sample output of the program is given below.. and also the copy of the output will be saved to the file.

Add a comment
Know the answer?
Add Answer to:
Java 1. Create a 1D array of 4096 Unique random integer numbers of 1 to 5...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT