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 12:00
Which of the following does 3d animation create an illusion of on the screen? a. depth b. emotion c. length d. dialogue
Answers: 1
question
Computers and Technology, 22.06.2019 22:20
Pp 4.1 design and implement a class called sphere that contains instance data that represents the sphere’s diameter. define the sphere constructor to accept and initialize the diameter and include getter and setter methods for the diameter. include methods that calculate and return the volume and surface area of the sphere (see pp 3.5 for the formulas). include a tostring method that returns a one-line description of the sphere. create a driver class called multisphere, whose main method instantiates and updates several sphere objects.
Answers: 1
question
Computers and Technology, 23.06.2019 13:50
Explain how email technologies enable the exchange of messages between users. find out the typical parts of an email address and explain each part.
Answers: 1
question
Computers and Technology, 23.06.2019 21:20
For positive constants a and b, the force between two atoms in a molecule is given f(r) = −a r2 + b r3 , where r > 0 is the distance between the atoms. note: a and b are upper case letters. (a) find f '(r) = (b) find the critical point for f(r). r = (c) find f ''(r) = (d) find the value of r so that f ''(r) = 0.
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
Mathematics, 17.04.2021 01:00
question
Mathematics, 17.04.2021 01:00
question
Mathematics, 17.04.2021 01:00
question
Mathematics, 17.04.2021 01:00
question
Mathematics, 17.04.2021 01:00
question
Mathematics, 17.04.2021 01:00