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
The coordinates for the section element need not be defined as long as its position is set to
scoray [572]
<h2><u>Answer:</u></h2>

relative.

<h2><u>Explanation:</u></h2>

The coordinates for the section element need not be defined as long as its position is set to relative.

If the position is set as relative, then it will have no effect on the positioning attributes, it will consider as static position. If positioning is mentioned explicitly like top: 20px; then it will position 10 pixels down from where it is located. An ability for positional shifts is extremely helpful.

Two things happen when an element is set as relative, one is it introduces the ability to use z-index on that element, second is it limits the scope of absolutely positioned child elements.  

5 0
2 years ago
How many times is the second for loop going to loop in this block of code? Write your answer in numeric form in the box provided
pantera1 [17]

Explanation:

The second for loop does 1 of 4 iterations for every 1 of 5 iterations of the parent loop. meaning it is 4 x 5 which is 20.

8 0
2 years ago
What is a banner grab?
alexira [117]
Banner Grabbing is a technique used to gain information about a computer system on a network and the services running on its open ports. Administrators can use this to take inventory of the systems and services on their network.

Hope you find this helpful!
Brainliest and a like is much appreciated!
3 0
2 years ago
You currently are IT support for Richman Investments, a brokerage firm that employs 20 brokers. Each broker has their own client
lions [1.4K]

Answer:

Use the System Restore tool to restore the affected computers back to a point before the problematic updates. To forestall issues with problematic updates, one needs to install and configure the Windows Server Update Services (WSUS) Server role.

Explanation:

Windows Update creates a restore point prior to applying any updates and this makes it easier to rollback any problematic updates using the aptly named System Restore utility.  System Restore can be launched either from within Windows or during startup depending on whether the computer can be booted  or not.

One solution to preventing this kind of problem is the implementation of a Windows Server role, the Windows Server Update Services (WSUS), which helps administrators to safely manage Windows Update for clients within its network. WSUS allows administrators to test updates for issues and approve them before they are available for deployment to clients.

4 0
2 years ago
I have a message for anyone reading this
uysha [10]

Answer:zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

Explanation:

4 0
2 years ago
Other questions:
  • What is the software called that allows the user to create, access, and manage a database? question 8 options:
    10·1 answer
  • To calculate the chapter from which you must solve the programming exercise, divide the integer number representing your student
    10·1 answer
  • You've decided to use a subnet mask of 255.255.192.0 with your 172.17.0.0 network to create four separate subnets. The network I
    13·1 answer
  • When Amy turns on her computer, she notices a burning smell. Smoke comes out of the case, and Amy immediately turns off her comp
    7·1 answer
  • What are advantages and disadvantages of developing a more robust Internet of Things and continuing to add more smart nodes?
    10·1 answer
  • What was used to enhance silent films of the early 1900s
    15·1 answer
  • Read the scenario and then answer the question using only the information provided.
    7·1 answer
  • The average American has 10 devices, ask for users average number of devices. Any number between 7 and 12 will print “you have a
    13·1 answer
  • A while loop is frequently used to ______________ data.
    5·1 answer
  • Criminal investigations are limited to finding data defined in the search ____.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!