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
Ulleksa [173]
3 years ago
5

#include using namespace std; int main( ) { const int NUM_ROWS = 2; const int NUM_COLS = 2; int milesTracker[NUM_ROWS][NUM_COLS]

; int i = 0; int j = 0; int maxMiles = -99; // Assign with first element in milesTracker before loop int minMiles = -99; // Assign with first element in milesTracker before loop milesTracker[0][0] = -10; milesTracker[0][1] = 20; milesTracker[1][0] = 30; milesTracker[1][1] = 40;
Computers and Technology
1 answer:
VARVARA [1.3K]3 years ago
5 0

Answer:

#include <iostream>

using namespace std;

int main()

{

   const int NUM_ROWS = 2;

   const int NUM_COLS = 2;

   int milesTracker[NUM_ROWS][NUM_COLS];

   int i = 0;

   int j = 0;

   int maxMiles = -99; // Assign with first element in milesTracker before loop

   int minMiles = -99; // Assign with first element in milesTracker before loop

   milesTracker[0][0] = -10;

   milesTracker[0][1] = 20;

   milesTracker[1][0] = 30;

   milesTracker[1][1] = 40;

   

   maxMiles = milesTracker[0][0];

   minMiles = milesTracker[0][0];

   

   for (i = 0; i < NUM_ROWS; i++){

       for (j = 0; j < NUM_COLS; j++){

           if (milesTracker[i][j] > maxMiles){

               maxMiles = milesTracker[i][j];

           }

           if (milesTracker[i][j] < minMiles){

               minMiles = milesTracker[i][j];

           }

       }

   }

   

   cout << "Min: " << minMiles << endl;

   cout << "Max: " << maxMiles << endl;

   return 0;

}

Explanation:

It seems you want to find the min and max value in the array. Let me go through what I added to your code.

Set the maxMiles and minMiles as the first element in milesTracker

Create a nested for loop that iterates through the milesTracker. Inside the loop, check if an element is greater than maxMiles, set it as maxMiles. If an element is smaller than minMiles, set it as minMiles.

When the loop is done, print the minMiles and maxMiles

You might be interested in
Which category does this fall in identity theft​
g100num [7]

Answer:

A crime.

Explanation:

It's illegal.

8 0
3 years ago
What does NOT match with Agile Manifesto?
Butoxors [25]

Answer:

yes

Explanation:

7 0
3 years ago
What is the correct sequence in which a computer operates​
GrogVix [38]

Answer:

Booting is a startup sequence that starts the operating system of a computer when it is turned on. A boot sequence is the initial set of operations that the computer performs when it is switched on. Every computer has a boot sequence.

8 0
3 years ago
Describe the difference between the circumscribed and inscribed options when using the AutoCAD Polygon command
marysya [2.9K]

Answer: Describe the difference between circumscribed and inscribed options when using the autocad polygon tool. Circumscribed draws the object around the circle while inscribed draws the object inside the circle. The Length is equal to 5.3151 and the Angle is equal to 41 degrees.

Explanation:

3 0
2 years ago
Technology trends in education play a key role in a student’s: social life. motivation. career readiness. job search.
skelet666 [1.2K]

Answer:

job search

Explanation:

job search bc you can look for jobs that are avalible online.

4 0
3 years ago
Read 2 more answers
Other questions:
  • Being able to express your thoughts in an email is a primary technology skill. True or False
    8·2 answers
  • the equation t= 0.25d^1/2 can be used to find the number of seconds, t, that it takes an object to fall a distance of d feet how
    8·1 answer
  • Which of the following jobs is considered part of the information technology industry?
    15·2 answers
  • Componets of computer
    5·1 answer
  • You open the home page for www.alpineskihouse. On the home page, you see a link for the weather report. You want to view the wea
    6·1 answer
  • What should be used to keep a tablet dry?
    13·1 answer
  • Richard needs to copy information from another slide presentation that uses a different design template. To ensure that the info
    10·1 answer
  • Code: ckg-jbqp-hki<br>only girls join❤️​
    11·2 answers
  • What are the advantages of customer relationship managment​
    10·1 answer
  • Why are iterators useful?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!