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
Select the correct answer from each drop down menu
nadya68 [22]

Answer:

Blank 1: reflects

Blank 2: rays

sorry if i get this wrong those are the only two that makes sense.

Explanation:

6 0
3 years ago
Read 2 more answers
What is the accurate description
Airida [17]

Answer:

an accurate description exact stresses a very strict agreement with fact, standard, or truth. Exact measurements precise adds to exact an emphasis on sharpness of definition or delimitation.

PLEASE MARK ME AS BRAINLIEST ANSWER THANKS

8 0
2 years ago
String[][] arr = {{"Hello,", "Hi,", "Hey,"}, {"it's", "it is", "it really is"}, {"nice", "great", "a pleasure"},
wolverine [178]

Answer:

Explanation:

The code that will be printed would be the following...

Hi, it is great to get to see you again

This is mainly due to the argument (k==1), this argument is basically stating that it will run the code to print out the value of second element in each array within the arr array. Therefore, it printed out the second element within each sub array to get the above sentence.

7 0
3 years ago
Would my phone still work if I snapped it in half?
RSB [31]
Probably not
Not a good idea my friend
3 0
3 years ago
Read 2 more answers
11. John wants to share resources and move a large volume of data quickly over the Internet. John should use which of the follow
Anvisha [2.4K]
The correct options are as follows:
11. B
UUCP is a suit of computer programs and protocol, which enables remote execution of commands and transfer of files between computers. One of the command in the suite provides a user interface for requesting file copy operation.
12. C.
HTML document refers to a file that is containing a Hypertext Markup Language. It is usually made up of texts and graphics. HTML is used to create electronic documents which are displayed on the world wide web. Each page usually contains series of connections to other pages which are called hyperlinks. HTML tags are hidden keywords within the web page which defines how the web browser format and display the contents.
13. B.
Long documents can be divided into preliminary pages, main text and the index. The preliminary pages will include all the materials that the author want to add to the book that is different from the main texts, such as copyright section, acknowledgment, etc; while the back matter will make up of all the other materials that can not be added to the main text due to one reason or the other.
14. A
A margin refers to the area between the main context of a page and the page edges. The margin helps to define the point where the text begins and where it ends. The normal paper margin is one inch space. Microsoft word allows one to change paper margin according to one's desire.
15. A.
There are different types of fonts and other formatting tools in the Microsoft word which can be used to design the text that are produce on the software. For the sentence given above, the font used is Roman San serif type and the words are bolded.
16. D
A pica is equivalent to 1/6 of an inch. That is, 1 inch = 6 picas.
Then 5 inches will be equal to: 5 * 6 = 30.
Thus, 5 inches is equivalent to 30 picas.
17. A.
Leading refers to the space between lines of types; it is also called line spacing. Leading is measured in points from one baseline to the other. The leading value include the point size of the typeface and the actual space between the lines.
18. D.
Page column refers to vertical blocks of contents positioned on a page,which is separated by gutters or rules. Columns are usually used to break up large body of text that can not fit into a single block of text on a page.
19. C.
Typography is the procedure of arranging type data in order to make it legible, readable and appealing when it is displayed. It involves the process of formatting the type document using the available formatting tools on the Microsoft word.
20. C
A pica refers to a unit of type size and line length, which is equal to 12 points. A point is equal to 1/12 of a pica and so there are 12 points in a pica. In typography, a point is the smallest unit of measure, it is used for measuring font size, leading and other items on the printed page. 


 


8 0
3 years ago
Other questions:
  • Write a program that reads in the length and the width of a rectangular yard.
    5·1 answer
  • Which sign or symbol will you use to lock cells for absolute cell reference
    5·1 answer
  • Going to Grad School! In the College of Computing and Software Engineering, we have an option for students to "FastTrack" their
    11·1 answer
  • You view a portion of a document on the screen through a
    14·1 answer
  • What power brake uses vacuum from the engine to aid in brake application?
    6·2 answers
  • What is the difference between LANs and WANs and the internet
    11·2 answers
  • Which is not one of the four criteria for proving the correctness of a logical pretest loop construct of the form: while B do S
    14·1 answer
  • What is a key differentiator for Accenture when delivering Artificial Intelligence (AI) solutions to clients?
    11·1 answer
  • Describe psychographic differences among the past five generations of Americans that you learned about in this course. What type
    6·1 answer
  • If you give someone ______ to your device, they can control it through another phone or computer.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!