Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

More Books

Students also viewed these Databases questions

Question

Detailed note on the contributions of F.W.Taylor

Answered: 1 week ago

Question

6. Is all Internet training the same? Explain.

Answered: 1 week ago