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
Minchanka [31]
3 years ago
12

CHALLENGE ACTIVITY |

Computers and Technology
1 answer:
fredd [130]3 years ago
6 0

Answer:

maxSum = FindMax(numA, numB) + FindMax(numY, numZ);  

The maxSum is a double type variable which is assigned the maximum of the two variables numA numB PLUS the maximum of the two variables numY numZ using FindMax function. The FindMax() method is called twice in this statement one time to find the maximum of numA and numB and one time to find the maximum of numY numZ. When the FindMax() method is called by passing numA and numB as parameters to this method, then method finds if the value of numA is greater than that of numB or vice versa. When the FindMax() method is called by passing numY and numZ as parameters to this method, then method finds if the value of numY is greater than that of numZ or vice versa. The PLUS sign between the two method calls means that the resultant values returned by the FindMax() for both the calls are added and the result of addition is assigned to maxSum.

Explanation:

This is where the statement will fit in the program.

#include <iostream>

using namespace std;

double FindMax(double num1, double num2) {

  double maxVal = 0.0;    

  if (num1 > num2) { // if num1 is greater than num2,

     maxVal = num1;  // then num1 is the maxVal.    }

  else {          

     maxVal = num2;  // num2 is the maxVal.   }

  return maxVal; }  

int main() {

  double numA;

  double numB;

  double numY;

  double numZ;

  double maxSum = 0.0;  

maxSum = FindMax(numA, numB) + FindMax(numY, numZ);  

  cout << "maxSum is: " << maxSum << endl;   }

Lets take an example to explain this. Lets assign values to the variables.

numA = 6.0

numB = 3.0

numY = 4.0

numZ = 9.0

maxSum =0.0

maxSum = FindMax(numA, numB) + FindMax(numY, numZ);  

FindMax(numA,numB) method call checks if numA>numB or numB>numA and returns the maximum of the two. Here numA>numB because 6.0 is greater than 3.0. So the method returns numA i.e. 6.0

FindMax(numY, numZ) method call checks if numY>numZ or numZ>numY and returns the maximum of the two. Here numZ>numY because 9.0 is greater than 4.0. So the method returns numZ i.e. 9.0

FindMax(numA, numB) + FindMax(numY, numZ) this adds the two values returned by the method FindMax for each call.

FindMax returned maxVal from numA and numB values which is numA i.e. 6.0.

FindMax returned maxVal from numY and numZ values which is numZ i.e. 9.0.

Adding these two values 9.0 + 6.0 = 15

So the complete statement  FindMax(numA, numB) + FindMax(numY, numZ) gives 15.0  as a result.

This result is assigned to maxSum. Hence

maxSum = 15

To see the output on the screen you can use the print statement as:

cout<<maxSum;

This will display 15

You might be interested in
What is the first thing you should do to find a mean and range of data?
KatRina [158]

Answer

To find mean of data add all the numbers in the set of data and divide the sum by the number of addends.

To find range, identify the difference between the highest value and lowest value in the set of data.

Explanation

Mean, mode, median and range are the primary measurements used to get the measures of central tendencies. To get the mean and range; first arrange the data in an ascending order, then identify the highest value and the lowest value in the set. The difference between these two data values gives the range of the set of values. For the mean, add all the set of values and then divide their sum with the number of values in the set of data.


6 0
3 years ago
A project manager sets up a recurring invite for meetings using a web-based calendar app on a mobile device. What type of automa
eduard

A project manager uses a mobile device's web-based calendar tool to set up recurrent meeting invitations. The type of automation this exemplifies is Intelligent automation.

<h3>What is intelligent automation?</h3>

Intelligent automation is also called alternately intelligent process automation. This is a type of software that includes artificial intelligence and robotics.

The combined software provides end-to-end business automation and quickens digital transformation. There are three types of IA. Narrow, super, and general IA.

Thus, the type of automation this exemplifies is Intelligent automation.

To learn more about intelligent automation, refer to the below link:

brainly.com/question/28222698

#SPJ4

6 0
1 year ago
Who was the creator of the game Fnaf?
Lisa [10]
"Scott Cawthon" did that.........
8 0
3 years ago
Read 2 more answers
What can a user do using the Contact Group dialog box? Check all that apply.
RSB [31]

Answer:

1,2,4,5,7

Explanation:

Had the question

3 0
3 years ago
Read 2 more answers
Non-preemptive Shortest Job First (SJF) scheduling policy is not optimal if:
ivann1987 [24]

Answer:

The answer is A

Explanation:

Basically, Shortest job first (SJF) is a scheduling policy that selects jobs on queue for execution  within a short execution time.

From the definition of SJF above, it means that there are a lot of process on queue and the (SJF) job is to receive processes on queue to execute within a short execution time.

Therefore, if all the jobs or process arrives at the SJF at the same time, the SJF will forfeit one of its major purpose which is scheduling of jobs.

That will therefore not make Non-preemptive Shortest Job First (SJF) not function at its optimal point.

4 0
3 years ago
Other questions:
  • What is the binding time for the following in C/C++ program. Explain. a. The location of memory of a local variable in a functio
    9·1 answer
  • Sanjay is giving a slideshow presentation on his entire college class and he is feeling quite nervous in order to share his pres
    9·1 answer
  • What does psychologist Edward Spector mean when he says “ We have an entire generation of guinea pigs in an experiment”?
    14·1 answer
  • Which statement best describes the cut and paste option in a word processor?
    6·2 answers
  • Describe how one can change row and height
    6·1 answer
  • A computer processes data using only 1s and 0s true or false?
    9·2 answers
  • Write a function called missing_letters that takes a string parameter and returns a new string with all the letters of the alpha
    7·1 answer
  • Does anyone know why I get notifications on Brainly that say they are from 4 hours ago even though they were just answered
    9·1 answer
  • What are the five Ws?<br> (I don’t even know what this means)
    5·2 answers
  • Which graphic file format would you choose if you needed to make an animated graphic for a website?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!