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
Artist 52 [7]
2 years ago
9

Find the maximum value and minimum value in milesTracker. Assign the maximum value to maxMiles, and the minimum value to minMile

s. 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:
lina2011 [118]2 years ago
8 0

Answer: 40, 4

Explanation:

You might be interested in
What is the requirement for self-contained recovery devices
dexar [7]
Babahskdjdndnd jbsbsjsjsnsns ndsnssnsnsnxjxjx skzjnansmansna Jaunansmans
4 0
2 years ago
I made a binary sentence if you answer you get 75 points heres the code: 01101001 01100110 00100000 01111001 01101111 01110101 0
butalik [34]

01001001 00100000 01100001 01100011 01110100 01110101 01100001 01101100 01101100 01111001 00100000 01110101 01110011 01100101 01100100 00100000 01100001 00100000 01000010 01101001 01101110 01100001 01110010 01111001 00100000 01100011 01101111 01100100 01100101 00100000 01000011 01101111 01101110 01110110 01100101 01110010 01110100 01100101 01110010 00100000 01101100 01101101 01100001 01101111

6 0
3 years ago
Read 2 more answers
Convert the following C program to C++.
ki77a [65]

Answer:

The program equivalent in C++ is:

<em>#include <cstdio></em>

<em>#include <cstdlib></em>

#define SIZE 5

using namespace std;

<em>int main(int argc, char *argv[]) {</em>

<em>int numerator = 25;</em>

<em>int denominator = 10;</em>

<em>FILE * inPut = fopen(argv[1], "r");</em>

<em>FILE * outPut = fopen(argv[2], "w");</em>

<em>float result = (float)numerator/denominator;</em>

<em>fprintf(outPut,"Result is %.2f\n", result);</em>

<em>float arr[SIZE];</em>

<em>for(int i = 0; i < SIZE; i++) {</em>

<em>fscanf(inPut, "%f", &arr[i]);</em>

<em>fprintf(outPut, "%7.4f\n", arr[i]);</em>

<em>}</em>

<em>return 0;</em>

<em>}</em>

Explanation:

See attachment for explanation.

Each line were numbered with equivalent line number in the C program

Download cpp
8 0
3 years ago
Amanda needs to create an informative print brochure for her local library’s fundraiser dinner. What critical detail must she ha
Charra [1.4K]

Answer: A. target audience for the brochure.

Before even starting the design of the brochure, Amanda needs to get information on who the target audience are going to be. Amanda will need to conduct a quick research on what the audience of their community likes and does not like. By understanding the target audience, Amanda will be able to get an idea of what design, colors, and format she would make that will attract the attention of their audience.

5 0
2 years ago
How and why Steve Jobs left Apple Computer.
Artist 52 [7]

Answer:

Jobs was forced out of Apple in 1985 after a long power struggle with the company's board and its then-CEO John Sculley. ... He was largely responsible for helping revive Apple, which had been on the verge of bankruptcy.

Explanation:

6 0
3 years ago
Other questions:
  • A popular encryption method used to protect data that travel over a wireless network is ____
    12·1 answer
  • Over the last few years, security cameras and other devices have become more common. Some people argue that these measures viola
    14·2 answers
  • Which icon is greater in file size? (Show your working)
    8·1 answer
  • The Mark Table of Contents Entry option is used for marking nonheading text for the table of contents. the options are manually
    5·2 answers
  • Which software application offers a variety of templates for creating reports, flyers, and newsletters that you can access withi
    12·1 answer
  • Preciso de ajuda urgente, é para amanhã cedo!!
    10·1 answer
  • Most project files will contain:
    9·1 answer
  • A small startup company has hired you to harden their new network. Because funds are limited, you have decided to implement a un
    8·1 answer
  • Digital communication and production chapter 17
    6·1 answer
  • Which discipline focuses on the design of computer hardware?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!