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
Icon view, list view, and details view are all common views provided by which kind of program?
RideAnS [48]
The standard program that uses common views such as the icon view, list view, and details view would be the program known as "File Explorer" (Windows) or "Finder" (Mac). This program uses all the views to make selecting and tracking down certain files a much more painless and easier process to complete.

Hope this helps and good luck! :)
6 0
3 years ago
Read 2 more answers
Create the content for your website.
arlik [135]
What do you need help with? I’m confused
5 0
3 years ago
Several of the items below indicate the steps required to move a slide to a different location in a presentation. Select those s
NikAS [45]
The answer should be
2
4
3
5
1
6
8 0
3 years ago
Read 2 more answers
an ssl client has determined that the certificate authority (ca) issuing a server's certificate is on its list of trusted cas. w
TEA [102]

The next step in verifying the server's identity is:

  • The CA's public key need to validate the CA's digital signature found on the server certificate.

<h3>What is SSL client?</h3>

Secure Sockets Layer (SSL) is known to be a kind of PKI protocol that helps to  authenticate a user's identity and it is one that often encrypt the communication that takes place between the client and the server.

Note that  in the above, the next step in verifying the server's identity is:

  • The CA's public key need to validate the CA's digital signature found on the server certificate.

Learn more about SSL client from

brainly.com/question/14425531

#SPJ11

8 0
2 years ago
True or false.
RideAnS [48]
I think it’s true that you can select image properties from the image menu
6 0
3 years ago
Other questions:
  • The term _____ best describes the level of technology skills needed in today’s business world.
    15·1 answer
  • What is returned by the code: range (5, 100, 25) ?
    7·2 answers
  • Which of the following would an A/V technician NOT typically do? (Select all that apply).
    14·1 answer
  • Enter a formula in cell b7 to calculate the average value of cells b2:b6
    13·1 answer
  • EASY POINTS what favorate food<br> so easy
    7·2 answers
  • Misspelet errors are displays with a ...<br>.. below them<br>​
    10·1 answer
  • What is the gear ratio?
    12·1 answer
  • I will have to goste yall im busting my butt off doing homework
    10·2 answers
  • A(n) ________ is a box consisting of a radio receiver/transmitter and antennas that links to a wired network, router, or hub.
    11·1 answer
  • If your computer determines the destination address of a network packet is to a remote network.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!