Question: first execution line of a class should be a class statement please *8.21 (Central city) Given a set of cities, the central city is the

first execution line of a class should be a class statement please
*8.21 (Central city) Given a set of cities, the central city is the city that has the shortest total distance to all other cities. Write a program that prompts the user to enter the number of cities and the locations of the cities (coordinates), and finds the central city and its total distance to all other cities. Sample Run for Exercise08_21.java Enter input data for the program (Sample data provided below. You may modify it.) 5 2.5 5 5.1 3 1 9 5.4 54 5.5 2.1 Show the Sample Output Using the Preceeding Input Reset Execution Result: JDK8>java Exercise08_21 Enter the number of cities: 5 Enter the coordinates of the cities: 2.5 5 5.1 3 1 9 5.4 54 5.5 2.1 The central city is at (2.5, 5.0) The total distance to all other cities is 60.810516285521615 DK3Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
