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
MAVERICK [17]
3 years ago
10

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: -10Max miles: 40#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; /* Your solution goes here */ cout << "Min miles: " << minMiles << endl; cout << "Max miles: " << maxMiles << endl;}
Computers and Technology
1 answer:
ryzh [129]3 years ago
6 0

Answer:

Following are th program in the C++ Programming Language.

#include <iostream>//set Header files

using namespace std;//set namespace

//define main function

int main()

{

//set integer constants variable

const int NUM_ROWS = 2;

//set integer constants variable

const int NUM_COLS = 2;

//set integer type array

int milesTracker[NUM_ROWS][NUM_COLS];

//set integer type variable and initialize to 0

int i = 0;

//set integer type variable and initialize to 0

int j = 0;

//set integer type variable and initialize to -99

int maxMiles = -99;

//set integer type variable and initialize to -99

int minMiles = -99;

//initialize the value in the two dimensional array

milesTracker[0][0] = -10;

milesTracker[0][1] = 20;

milesTracker[1][0] = 30;

milesTracker[1][1] = 40;

//here is the solution  

maxMiles = milesTracker[0][0];

minMiles = milesTracker[0][0];

/*set for loop to find the minimum miles and maximum miles*/

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

{

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

 {

 //set if condition for maxMiles is the bigger than

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

   //initialize milesTracker[i][j] to maxMiles

     maxMiles = milesTracker[i][j];

   //set if condition for minMiles is the smaller than

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

   //initialize milesTracker[i][j] to maxMiles

     minMiles = milesTracker[i][j];

 }

}

//print output

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

//print output

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

return 0;

}

<u>Output:</u>

Min miles: -10

Max miles: 40

Explanation:

Here, we define the main method and inside it:

  • set two constant integer type variable and initialize to 2
  • set integer type two-dimensional array and pass constant variables in it.
  • Set two integer type variable and initialize to 0 then, again set two integer type variable and initialize to -99.
  • Initialize the values in the two-dimensional array.
  • Set two for loop for the two-dimensional array to find the minimum and maximum miles.
  • Set two if condition to find bigger or smaller miles.

Finally, print the maximum and the minimum miles then, return 0.

You might be interested in
Compare the graphs. Find the value of h, k, or a.
Serga [27]

Answer:

dchdchbhdcdc

Explanation:

6 0
3 years ago
Which protocols are TCP/IP application layer protocols? (choose all that apply)
natita [175]

Answer:

Option(b) and Option(c) is the correct answer for the given question.

Explanation:

TCP stands for transmission control protocol, In the TCP protocol firstly it maintains the connection between the sender and the receiver. The receiver always gives an acknowledgment to the sender when it receives the information that's why TCP is reliable protocol it is found in TCP/IP application layer protocols    

UDP stands for user datagram protocol, In the UDP protocol, it does not maintain the connection between the sender and the receiver. The receiver does not give any acknowledgment to the sender that why UDP is not a reliable protocol . it is also found in the TCP/IP application layer protocols

  • In the option(a) IP is found in the network layer that why this option is incorrect.
  • In the option(d) FTP is found in the application layer thats why this option is incorrect .

Hence TCP and UDP are TCP/IP application layer protocols

5 0
3 years ago
Read 2 more answers
Calculate how many different pixel colours could be formed if one of the bytes gives the intensity of the red colour, one of the
Elena L [17]

Answer: The three RGB colors are each 8-bits (possible values [0.. 255], 2 to the power of 8 = 256) of each of Red, Green, and Blue. The three 8-bit RGB components can create up to 256×256×256 = 16.7 million possible RGB color combinations, called 24-bit "color".

Explanation:

6 0
3 years ago
How to change screen brightness windows 10?
astraxan [27]
Click on the Notification icon at the bottom right of the screen -> Choose 'Expand' -> Then you will see the sun icon, click on that to choose the brightness. Thank you

4 0
4 years ago
Explain input device​
Kamila [148]

Answer: ......wlc;)

Explanation: Any information or data sent to a computer for processing is considered input. Input or user input is sent to a computer using an input device. The picture is an illustration of the difference between input and output. The input example (top) shows data being sent from a keyboard to a computer

4 0
3 years ago
Read 2 more answers
Other questions:
  • How do keystroke dynamics determine whether to authenticate an individual or not?
    14·1 answer
  • In the processes tab of task manager, the ____ tab displays the âworking setâ of a process, or the amount of memory it is active
    12·1 answer
  • Write a program that asks the user for three strings. Then, print out whether the first string concatenated to the second string
    8·1 answer
  • The Quick Access Toolbar cannot be customized and have extra commands added to it
    5·1 answer
  • A byte contains how many bits? Question 3 options:
    13·2 answers
  • You are network administrator for an Active Directory forest with a single domain. Then network has three sites with one domain
    12·1 answer
  • Which elements of text can be changed using automatic formatting? Check all that apply.
    8·1 answer
  • Write a logical expression using only and, or and not that is equivalent to the Exclusive NOR (XNOR) gate on 2 inputs, called in
    15·1 answer
  • Text Questions
    15·1 answer
  • Select one Layer 2 or wireless WAN technology presented in Lesson 3. Elaborate on its characteristics, pros and cons, and common
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!