Question
I need help with the flowchart, pseudocode, and UML diagram. Location.java public class Location { public int row,column; public double maxValue; public Location(int row, int
I need help with the flowchart, pseudocode, and UML diagram.
Location.java
public class Location {
public int row,column;
public double maxValue;
public Location(int row, int column, double maxValue){
this.row = row;
this.column =column;
this.maxValue = maxValue;
}
}
TestLocation.java
import java.util.Scanner;
public class TestLocation {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.print("Enter the number of rows and columns in the array: ");
int rows = scan.nextInt();
int cols = scan.nextInt();
double d[][] = new double[rows][cols];
System.out.print("Enter the array:");
for(int i=0; i for(int j=0; j d[i][j] = scan.nextDouble(); } } Location l = locateLargest(d); System.out.println("The location of the largest element is "+l.maxValue+" at ("+l.row+", "+l.column+")"); } public static Location locateLargest(double[][] a){ double max = a[0][0]; int row =0 , col=0; for(int i=0; i for(int j=0; j if(max max = a[i][j]; row = i; col = j; } } } Location l = new Location(row,col,max); return l; } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started