Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help me write the pseudocode, create a flowchart with the appropriate shapes, and a Test Plan / Test Case Matrix for the following Java
Please help me write the pseudocode, create a flowchart with the appropriate shapes, and a Test PlanTest Case Matrix for the following Java code.
"Write a test program that prompts the user to enter a twodimensional array and displays the location of the largest element in the array.
If there are more than one largest element, find the location with the smallest row index and then the smallest column index."
import java.util.Scanner;
public class Exercise
public static void mainString args
Create a Scanner object for user input
Scanner scanner new ScannerSystemin;
Prompt the user to enter the number of rows and columns
System.out.printEnter the number of rows and columns of the array: ;
int rows scanner.nextInt;
int columns scanner.nextInt;
Create a D array based on user input
double array new doublerowscolumns;
Prompt the user to enter the array elements
System.out.printlnEnter the array:";
for int i ; i rows; i
for int j ; j columns; j
arrayij scanner.nextDouble;
Call the locateLargest method to get the location of the largest element
int location locateLargestarray;
Display the location of the largest element
System.out.printlnThe location of the largest element is at location location;
public static int locateLargestdouble a
int location new int;
double largest a;
Find the largest element and its location
for int i ; i alength; i
for int j ; j ailength; j
if aij largest
largest aij;
location i;
location j;
return location;
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