Question: Write a program that does the following steps 1 . Generate an array of 5 0 random integers from 0 to 1 0 5 .

Write a program that does the following steps
1. Generate an array of 50 random integers from 0 to 105. Call this array num1_arr
2. Generate another array of 50 random integers from 90 to 199. Call this array num2_arr
3. Write a void method called closestDist (int [] num1_arr, intl] num2_arr) that prints out
the closest distance between the 2 arrays and the 2 numbers with their indices
You MUST use a nested for loops inside this method to find the closest distance. Do not use any built-in metaods to sort the array.
For example, here is a sample output
The min distance between the 2 arrays -15
The 2 numbers are:
87 in the first array with index 9
102 in the second array with index 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!