Hi, I have been beating my head against the wall trying to figure this out. I am trying to figure out the minimum and maximum value for a single row. I have added the values from three rows of a two dimensional array into a fourth row and I want to get the minimum and maximum value from the row but I can't seem to figure it out. The code below gives me weird results. I set my min and max at  because I only want to scan row 3. Thanks for the help.
int min = sales;
for (int row = 3; row < sales.length; row++)
for (int column = 0; column < grades.length; column++)
if (sales[row][column] < min)
min = sales[row][column];
int max = grades;
for (int row = 0; row < sales.length; row++)
for (int column = 0; column < sales.length; column++)
if (sales[row][column] > max)
max = sales[row][column];
Linear search (searching each index in an array one by one) works almost everywhere but it is not optimal in many cases. Let's assume, we have a book which has 42949672960 pages. We also have a table of contents. Now we want to read the content on p…
The greatest common divisor (gcd) of two positive integers is their largest common divisor. Let's consider two numbers 12 and 20.
The divisors of 12 are 1, 2, 3, 4, 6, 12
The divisors of 20 are 1, 2, 4, 5, 10 20
The highest number among the c…
Viewers will learn one way to get user input in Java.
Introduce the Scanner object:
Declare the variable that stores the user input:
An example prompting the user for input:
Methods you need to invoke in order to properly get user input: