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 an example of an intelligent automation solution that makes use of artificial intelligence?.
mafiozo [28]

Copying text from a web browser is an example of an intelligent automation solution that uses artificial intelligence.

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

The intelligent automation solution is the combination of new technologies such as artificial intelligence and robotic automations that helps to enhance and enable the program to learn, interpret, and respond by itself.

The complete questions is as follows:

  1. signing-in to various desktop applications
  2. filling out forms with basic contact information
  3. copying text from a web browser
  4. recognizing and interpreting natural language

The best example for  intelligent automation solution is copying text from web browser as the AI interprets the command and the robotic automation will provide its output.

Therefore, option 3. is correct.

Learn more about intelligent automation solution, here:

brainly.com/question/24977867

#SPJ1

7 0
2 years ago
Which of the following statements is true?
Free_Kalibri [48]
C, <span>Word processing can be used to create databases of information.</span>
7 0
3 years ago
Read 2 more answers
Can someone else kill Raz and I can still get the challenge done by collecting the artifact in fort nite?
Margarita [4]
No Stop playing fort nite and play warzone
8 0
3 years ago
What is the name of the place where students access all of their course information? Student handbook. Learning management syste
ehidna [41]
The syllabus is where students can find their course information.
3 0
3 years ago
What is the simplest way to permanently get rid of an unwanted file on the computer
Mrac [35]
Delete it. Also defragmentation may be an option if your computer is running slow.
8 0
4 years ago
Other questions:
  • 4. Name and fix the two errors in the following piece of code that is intended to print “Debugging is fun!”. print //(“Debugging
    11·1 answer
  • business owners and managers may first balk at the idea of mobile officer workers because there may appear to be a lack of ___ w
    9·1 answer
  • How can you exaggerate the height of a jump in a photograph
    10·1 answer
  • How to do “Pseudocode” and “FlowChart” in this question ? <br><br> Please Help mee
    9·1 answer
  • Maria wants to create an image for a Web page. Maria should use _____. help me
    8·2 answers
  • 1. The Bank manager is imposing a 10% interest rate on the new salary loan to every account in the BPI Family Bank. (ANSWER SHOU
    15·1 answer
  • Who wont me???????????????
    6·2 answers
  • List and briefly explain four common template elements
    6·1 answer
  • Define a SCHEME function, unzip, which takes a list of pairs ((a .b)... (an .bn)) and returns a pair consisting of the two lists
    7·1 answer
  • Void printInfo()
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!