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, 22.06.2019 08:40
What are the three parts to physical security standards for various types of army equipment and the risk level
Answers: 2
question
Computers and Technology, 22.06.2019 14:30
Create a pseudocode design to prompt a student for their student id and the titles of the three classes they want to add. the solution should display the student’s id and a total bill. • bill a student using the following rules: o students can only add up to 3 classes at a time.
Answers: 3
question
Computers and Technology, 23.06.2019 00:30
If joey was single and his taxable income was $9,500, how much would he pay in taxes each year?
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
People with high self-esteem: accept their strengths and weaknesses. believe that failed experiences are failures of their whole self. feel good about who they are only when they reach total success. need positive external experiences to counteract negative feelings that constantly plague them.
Answers: 1
You know the right answer?
Find the maximum value and minimum value in milesTracker. Assign the maximum value to maxMiles, and...
Questions
question
Health, 14.10.2019 19:00
question
Mathematics, 14.10.2019 19:00
question
English, 14.10.2019 19:00
Questions on the website: 13722361