Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

create a Word document that contains the pseudocode, flowchart, and test plan for this java program. NB: The Flowchart must be the actual diagram, not

create a Word document that contains the pseudocode, flowchart, and test plan for this java program. NB: The Flowchart must be the actual diagram, not a sketch.
import java.util.Scanner;
public class Exercise08_13{
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print
("Enter the number of rows and columns of the array: ");
int numberOfRows = input.nextInt();
int numberOfColumns = input.nextInt();
double[][] a = new double[numberOfRows][numberOfColumns];
System.out.println("Enter the array: ");
for (int i =0; i < a.length; i++)
for (int j =0; j < a[i].length; j++)
a[i][j]= input.nextDouble();
int[] location = locateLargest(a);
System.out.println("The location of the largest element is at ("
+ location[0]+","+ location[1]+")");
}
public static int[] locateLargest(double[][] a){
int[] location = new int[2];
double largest = a[0][0];
for (int i =0; i < a.length; i++)
for (int j =0; j < a[i].length; j++){
if (largest < a[i][j]){
largest = a[i][j];
location[0]= i;
location[1]= j;
}
}
return location;
}
}

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_2

Step: 3

blur-text-image_3

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 Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions

Question

Psychologists must practice within the boundaries of competence.

Answered: 1 week ago