SUPPLEMENTAL ACTIVITIES (C++ PROGRAM) 1. Get the value of variable num assuming it is equal to 5. if (num >= 6) cout << "Yes"; cout << No; What will be the output? ______________________________________________________________ Explain your answer.________________________________________________________________ _________________________________________________________________________________ 2. What is the output of the following code fragment assuming num is 10? if (num == 20) cout << "teenager"; cout << "adult" Record the output screen display: ______________________________________________________ Explain your answer.________________________________________________________________ _________________________________________________________________________________ 3. After execution of the following code, what is stored in valueNum? All variables are using data type int. Note that num1=3, num2=5, and num3=7. if (num2> num3) if (num1 > num2) valueNum =num2; else valueNum =num3; else if (num2 > num3) valueNum =num1; else valueNum = num3; Record the output screen display: ______________________________________________________ Explain your answer.________________________________________________________________
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
SUPPLEMENTAL ACTIVITIES (C++ PROGRAM)
1. Get the value of variable num assuming it is equal to 5.
if (num >= 6)
cout << "Yes";
cout << No;
What will be the output? ______________________________________________________________
Explain your answer.________________________________________________________________
_________________________________________________________________________________
2. What is the output of the following code fragment assuming num is 10?
if (num == 20)
cout << "teenager";
cout << "adult"
Record the output screen display: ______________________________________________________
Explain your answer.________________________________________________________________
_________________________________________________________________________________
3. After execution of the following code, what is stored in valueNum?
All variables are using data type int. Note that num1=3, num2=5, and num3=7.
if (num2> num3)
if (num1 > num2)
valueNum =num2;
else
valueNum =num3;
else
if (num2 > num3)
valueNum =num1;
else
valueNum = num3;
Record the output screen display: ______________________________________________________
Explain your answer.________________________________________________________________
_________________________________________________________________________________
Step by step
Solved in 4 steps with 3 images