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
When the tv was created (year)
nikitadnepr [17]

Answer:

1927

Explanation:

6 0
3 years ago
Read 2 more answers
You have 5 salespersons who work out of your office and who frequently leave their laptops laying on their desk in their cubicle
kati45 [8]

There are different ways to ensure safety of devices. The best protection to implement to address your concerns is to use cable locks to chain the laptops to the desks.

  • The use of laptop locks is as good as when compared to bicycle chain locks. One can do this by looking for a big, immovable object, such as one's desk, and thereafter you wrap the metal cable around it and then insert the lock into your laptop's lock slot.

With this, your computer becomes theft-proof.

Thia will give you piece of mind as you will not be restless anymore.

Learn more about Laptop security from

brainly.com/question/24956493

3 0
3 years ago
An “evil twin” in the context of computer security is: a) A virus-laden attachment that looks just like a sincere attachment b)
aleksandr82 [10.1K]

Answer:

A

Explanation:

3 0
3 years ago
What are 3 data Gathering method that you find effective in creating interactive design for product interface and justify your a
ozzi

Answer:

In other words, you conducted the four fundamental activities that make up the interaction design process – establishing requirements, designing alternatives, prototyping designs, and evaluating prototypes.

Explanation:

5 0
3 years ago
A user calls to report that she is experiencing intermittent problems while accessing the wireless network from her laptop compu
mel-nik [20]

Answer:

Interference of signal and the range between the user and the access point.

Explanation:

Elevators, specifically those with high voltage, are notoriously known for being a source of very strong magnetic fields. They produce a lot of harmonics that causes signal interference and noise. Whenever there is any kind of noise in a network, it causes huge intermittent connection. Also, the farther away the user is from the router or the AP, the weaker the signals and the more the intermittencies.  The user is recommended to be within the edges if the range limit.

3 0
3 years ago
Read 2 more answers
Other questions:
  • When data are entered into a form and saved, they are placed in the underlying database as knowledge?
    10·1 answer
  • 7.
    6·1 answer
  • Powerpoint assumes that the first slide in a new presentation is the
    10·1 answer
  • Write a program that computes the monthly net pay of the employee for a steel factory. The input for this program is the hourly
    10·1 answer
  • As you type your outline, click Demote to move a line of text
    13·2 answers
  • For this assignment, select one of the organizations with a prominent IT department from the Topic 1 assignment. Once identified
    11·1 answer
  • HELP PLEASE
    14·1 answer
  • I figured out the secret message in Dad feels good, I can connect the dots
    8·1 answer
  • Which of these can be represented visually by a flowchart?
    11·2 answers
  • What is the difference between a status bar, title bar, and tabs?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!