subject

Find the maximum value and minimum value in milesTracker. Assign the maximum value to maxMiles, and the minimum value to minMiles. Sample output for the given program:Min miles: -10Max miles: 40Here's what I have so far:import java. util. Scanner;public class ArraysKeyValue { public static void main (String [] args) { final int NUM_ROWS = 2; final int NUM_COLS = 2; int [][] milesTracker = new int[NUM_ROWS][NUM_COLS]; int i = 0; int j = 0; int maxMiles = 0; // Assign with first element in milesTracker before loop int minMiles = 0; // Assign with first element in milesTracker before loop milesTracker[0][0] = -10; milesTracker[0][1] = 20; milesTracker[1][0] = 30; milesTracker[1][1] = 40;//edit from here for(i = 0; i < NUM_ROWS; ++i){ for(j = 0; j < NUM_COLS; ++j){ if(milesTracker[i][j] > maxMiles){ maxMiles = milesTracker[i][j]; } } } for(i = 0; i < NUM_ROWS; ++i){ for(j = 0; j < NUM_COLS; ++j){ if(milesTracker[i][j] < minMiles){ minMiles = milesTracker[i][j]; } } }//edit to here System. out. println("Min miles: " + minMiles); System. out. println("Max miles: " + maxMiles); }

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 20:40
Peripherals are part of the main computer. true false
Answers: 3
question
Computers and Technology, 22.06.2019 11:30
Write a function so that the main program below can be replaced by the simpler code that calls function original main program: miles_per_hour = float( minutes_traveled = float( hours_traveled = minutes_traveled / 60.0 miles_traveled = hours_traveled * miles_per_hour print('miles: %f' % miles_traveled) sample output with inputs: 70.0 100.0 miles: 116.666667
Answers: 3
question
Computers and Technology, 24.06.2019 03:40
4. does the kernel phenotype distribution support the idea that the cob is the result of a dihybrid cross? what information supports your answer? if a dihybrid cross (i.e. f1 to f2 of standard mendelian crosses) is not indicated what conditions might contribute to this finding.
Answers: 2
question
Computers and Technology, 24.06.2019 10:00
Each time you save a document, you will need to type in the file type in which it should be saved you can select the save button to save it with the same file name if it has been previously saved you will need to select the location to save the file you will need to use the save as dialog box
Answers: 1
You know the right answer?
Find the maximum value and minimum value in milesTracker. Assign the maximum value to maxMiles, and...
Questions
Questions on the website: 13722362