Question: Using the provided Java code, please help me create the pseudocode, flowchart ( preferred hand - drawn ) , functional requirements, and test plan /
Using the provided Java code, please help me create the pseudocode, flowchart preferred handdrawn functional requirements, and test planTest Case Matrix for both projects. In the flowchart, please include multiple charts if there is more than one method.
import java.util.Scanner;
public class Exercise
index info: x y total distance to all other cities
for simplicity
static final int X ;
static final int Y ;
static final int DISTANCE ;
public static void mainString args
Scanner input new ScannerSystemin;
System.out.printEnter the number of cities: ;
int numOfCities input.nextInt;
double points new doublenumOfCities;
System.out.printEnter the coordinates of the cities:
;
for int i ; i points.length; i
for int j ; j pointsilength ; j
pointsij input.nextDouble;
double central getCentralPointpoints;
System.out.printfThe central city is at ff
centralX centralY;
System.out.printfThe total distance to all other cities is f centralDISTANCE;
Compute the distance between two points x y and x y
public static double distance
double x double y double x double y
return Math.sqrtx xx xy yy y;
public static double getCentralPointdouble points
for int i ; i points.length; i
for int j ; j points.length; j
if j i
pointsiDISTANCE distancepointsiX pointsiY pointsjXpointsjY;
find point with the least total distance
and return central point
double central points;
for int i ; i points.length; i
if pointsiDISTANCE centralDISTANCE
central pointsi;
return central;
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
