subject
Engineering, 19.11.2019 01:31 kraigstlistt

Write a program that will find the pairs of coordinates that are closest to each other, as if these were 2 planes in space, flying too close to each other. report of the 2 pairs of coordinates that are closest to each other. display a warning message such as: "alert, alert! plane at coordinate: x-axis, y-axis is too close to plane at coordinate: x-axis, y-axis."

hints:

(1) define a class that can hold 2 coordinates. call it the location class. implement the comparable interface, and thus create a compareto() method.
(2) create an array of location objects, from reading the input file. (note: the first record in the input file contains the number of records in the file).
(3) sort the array by either x- or y-coordinate (use either the insertion sort or the selection sort algorithm. do not use collections.
(4) compare each object in the sorted array with the previous object, and calculate their distance by using the pythagorean formula below: double distancebetween2points = math. sqrt((x2 - x1)^2 + (y2 - y1)^2)

ansver
Answers: 1

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Abrake has a normal braking torque of 2.8 kip in and heat-dissipating cast-iron surfaces whose mass is 40 lbm. suppose a load is brought to rest in 8.0 s from an initial angular speed of 1600 rev/min using the normal braking torque; estimate the temperature rise of the heat dissipating surfaces.
Answers: 3
question
Engineering, 04.07.2019 18:10
Ariver flows from north to south at 8 km/h. a boat is to cross this river from west to east at a speed of 20 km/h (speed of the boat with respect to the earth/ground). at what angle (in degrees) must the boat be pointed upstream such that it will proceed directly across the river (hint: find the speed of the boat with respect to water/river)? a 288 b. 21.8 c. 326 d. 30.2
Answers: 3
question
Engineering, 04.07.2019 18:10
Afull journal bearing has a journal diameter of 27 mm, with a unilateral tolerance of -0.028 mm. the bushing bore has a diameter of 27.028 mm and a unilateral tolerance of 0.04 mm. the l/d ratio is 0.5. the load is 1.3 kn and the journal runs at 1200 rev/min. if the average viscosity is 50 mpa-s, find the minimum film thickness, the power loss, and the side flow for the minimum clearance assembly.
Answers: 1
question
Engineering, 04.07.2019 18:10
The higher the astm grain-size number, the coarser the grain is. a)-true b)-false
Answers: 3
You know the right answer?
Write a program that will find the pairs of coordinates that are closest to each other, as if these...
Questions
question
Mathematics, 16.10.2020 15:01
question
Mathematics, 16.10.2020 15:01
question
Mathematics, 16.10.2020 15:01
Questions on the website: 13722367