Question: How do I create a UML diagram for such a java class import java.util.Scanner; class Location { static int row, col; static double maxValue =

How do I create a UML diagram for such a java class

import java.util.Scanner; class Location { static int row, col; static double maxValue = 0; Location(int row, int col, double maxValue){ this.row = row; this.col = col; this.maxValue = maxValue; } public static Location locateLargest(double[][] a) { int maxRow = 0, maxCol = 0, cl; for (int rw = 0; rw < a[0].length - 1; rw++) { double currMax = a[rw][0]; int currMaxRow = rw; int currMaxCol = 0; for (cl = 0; cl < a[rw].length; cl++) { if (currMax < a[rw][cl]) { currMax = a[rw][cl]; currMaxRow = rw; currMaxCol = cl; } } if (maxValue < currMax) { maxRow = currMaxRow; maxCol = currMaxCol; maxValue = currMax; } } return new Location(maxRow, maxCol, maxValue); } }

public class Exercise09_13 { public static void main(String[] args) { double maxValue = 0; Location location; Scanner input = new Scanner(System.in); System.out.println("enter the number of rows and columns in the array: "); int row = input.nextInt(); int col = input.nextInt(); double[][] list = new double[row][col]; int cl, rw; System.out.println("enter the array"); for (rw = 0; rw < row; rw++) for (cl = 0; cl < col; cl++) list[rw][cl] = input.nextDouble(); new Location(row, col, list[row - 1][col - 1]); Location.locateLargest(list); System.out.println(" "); System.out.printf("the location of the largest element is %.2f at " + "(%d, %d)", Location.maxValue, Location.row, Location.col); } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!