Question: The problem for this lab assignment is: a. Get two integer numbers from the keyboard. b. Find the larger of the two numbers, for example,

The problem for this lab assignment is:

a. Get two integer numbers from the keyboard.

b. Find the larger of the two numbers, for example, 25 of 10 and 25

c. Calculate the summation of the two numbers, for example 35 of 10 and 25.

d. Print the larger number and the summation with the two input numbers.

e. The purpose of this lab is to learn how to use the user-defined functions so that you are required to use three (3) functions as following:

1) A function, "larger", gets two (2) numbers as parameters to return the larger number to the main.

2) A function, "sum", gets two (2) numbers as parameters to return the summation of the two numbers to the main.

3) A function, "print" gets four (4) numbers (two input data, the larger number, and the summation) to output the results.

f. You need to have three (3) function calls (each for "larger", "sum", and "print") in the main body.

5. Type your C++ code (provided by attachment below) into the compiler using the source code file name, "LargeNSum.cpp".

a. The program attached below is NOT completed missing one function prototype, one function call, and two function definitions. They are marked with *** to help you know what they are.

b. You need to fill them up to complete the program.

#include

using namespace std;

int larger (int, int);

int sum (int, int);

**** fill up with your code ***** print(**** fill up with your code *****);

int main()

{

int number1, number2, biggerNumber, total;

cout << "Enter two integer numbers: ";

cin >> number1 >> number2;

**** fill up with your code for calling larger function *****

**** fill up with your code for calling sum function *****

**** fill up with your code for calling print function *****

return 0;

}

int larger(**** fill up with your code *****)

{

int temp;

**** fill up with your code *****

return temp;

}

int sum(int first, int second)

{

int temp;

**** fill up with your code *****

return temp;

}

void print(int first, int second, int big, int tot)

{

cout << "The larger number of " << first << " and " << second << " is " << big << endl;

cout << "The summation of " << first << " and " << second << " is " << tot << endl;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!