Write a Java Program that accomplishes the following tasks: 1. Reads a positive
ID: 3529434 • Letter: W
Question
Write a Java Program that accomplishes the following tasks: 1. Reads a positive integer, n, following by the (x,y) coordinates of n points, storing these values in a two-dimensional array named Points with a n rows and two columns. 2. Creates a two-dimensional array with n rows and n columns named distances, with distances[i][j] = distance from points[i] to points [j]. 3. Creates a one dimensional array of length n named averages, with averages[i] = average of row i of distances. 4. Determines and prints which of the n points has the smallest average distance. These are my steps, please write a single program that includes 1-4 that can be compiled in java. Full rating to whomever can help with this.Explanation / Answer
public class TwoDimensionalExample { public static void main(String[] args) { int TwoDarray[][]=new int[0][0]; int k=0; for (int i=0; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.