Question: Create a flow chart with the below shapes for the follow Java program. / / Header file import java.util.Scanner; / / Defining the class class
Create a flow chart with the below shapes for the follow Java program.
Header file
import java.util.Scanner;
Defining the class
class Main
Defining the main
public static void mainString args
Creating Scanner object
Scanner scnew ScannerSystemin;
Getting input from the user
System.out.printEnter the number of cities:";
int nscnextInt;
Getting the coordinates from user
System.out.printEnter the coordinates of the cities:";
double coordnew doublen;
forint i;isum
totminsum;
indmini;
System.out.printlnThe central city is atcoordindmincoordindmin;
System.out.printlnThe total distance to all other cities is totmin;
Defining the distancetot method
public static double distancetotdoublecitiesint i
double sum;
forint j;j
Step 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
