1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
AnnZ [28]
2 years ago
11

Find the maximum value and minimum value in below mention code. Assign the maximum value to maxMiles, and the minimum value to m

inMiles. Sample output for the given program:
Min miles: -10
Max miles: 40
Here'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);
}
Computers and Technology
1 answer:
Kobotan [32]2 years ago
3 0

Answer:

Code works perfectly

Explanation:

There is nothing wrong with your program as it runs perfectly and displays the expected results.

You may need to compile with another compiler if you're not getting the required results.

I've added the source code as an attachment (unedited)

Download java
You might be interested in
You are almost finished updating a Website. As part of the update, you have converted all pages from HTML 4.0 to HTML5. The proj
Komok [63]

Answer:

a. The team needs to verify that the site will appear as expected in as many browsers as possible.

Explanation:

Upgrading to HTML5 is a good idea  you get a universal experience across a wide spectrum of devices. With HTML5, you get device ubiquity. You get a chance to build something once and have it work across a wide spectrum of browsers.

However, to a non technical person all these steps and coding you have taken to achieve this don't mean anything. They will only be satisfied with what they can observe physically and confirm there are no issues.

This is why option a is most appropriate as opposed to other options. The account manage will need to see and confirm that the site's HTML5 pages are appearing on many browsers as possible without any issue.

8 0
3 years ago
If after a run of arc consistency during the backtracking search we end up with the filtered domains of *all* of the not yet ass
Irina-Kira [14]

Answer:

True

Explanation:

3 0
3 years ago
When do images or graphics in Microsoft Word hurt the document rather than help
Vinvika [58]

Answer:

When images or graphics excessively occupy most of the space on the page.

<u>Explanation:</u>

For example, if you observed the attached image you'll see a bad example in which the image excessively occupies most of the space on the page making the written text difficult to read.

Next, a good example of proper editing is found in the next image, which shows the written text properly aligned with the text.

3 0
3 years ago
A technician needs to be prepared to launch programs even when utility windows or the Windows desktop cannot load. What is the p
lisov135 [29]

Answer:

Windows includes a tool called Microsoft System Information (Msinfo32.exe). This tool gathers information about your computer and displays a comprehensive view of your hardware, system components, and software environment, which you can use to diagnose computer issues.

Explanation:

7 0
3 years ago
Quality answers will be appriciated! :)​
Naddika [18.5K]
<h2>1.</h2>

  1. F
  2. T
  3. T
  4. T
  5. F
  6. F
  7. T

________

<h2>2.</h2>

  1. A
  2. B
  3. D5*E5
  4. A

6 0
2 years ago
Read 2 more answers
Other questions:
  • What type of lights are necessary for silhouettes?
    12·2 answers
  • You can use Facebook's Live Feed tool to broadcast content as you post it, true or false?
    11·1 answer
  • To prevent unauthorized access and use, at a minimum a company should have a written __________ that outlines the activities for
    6·1 answer
  • You can access a button s screentip by _____.
    6·1 answer
  • We have written a method called sum with an int[] parameter nums. We want our sum method to compute the sum of nums, but our cod
    5·1 answer
  • 2. Write a Python regular expression to replace all white space with # in given string “Python is very simple programming langua
    14·1 answer
  • Is anyone a robIox moderator?
    13·2 answers
  • What do you think will happen as more traditional jobs disappear due to technology? Will new jobs take their place?
    13·1 answer
  • Explain the basic operations of a computer system​
    6·1 answer
  • What economic impact will this disaster have on people? Select three options.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!