Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please make flowchart pseudocode and uml class diagram import java.util.Scanner; public class TestLocation{ public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.print(Enter

please make flowchart pseudocode and uml class diagram

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;

}

}

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;

}

}

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

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

=+j Describe the various support services delivered by IHR.

Answered: 1 week ago