Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database System

Authors: Elmasri Ramez And Navathe Shamkant

7th Edition

978-9332582705

More Books

Students also viewed these Databases questions

Question

A coupon for future price reductions

Answered: 1 week ago