1. A) Assume that the user input for x is 25. What will be the value of x after the following code is executed? if (x < 100) { x = x + 5; }if (x < 500) { x = x - 2; } if (x > 10) { x++; } else { x--; } B) How can you improve the following code structure? if (score < 40) { } else if (score >= 40 || score < 50) { } else if (score >= 50 || score < 60) { }else if (score >= 60 || score < 70) { } else if (score >= 70 || score < 80) { } else { } C) What will be printed on the console? char c = '0'; if(c > 90) ; cout << "The value of C is greater than 90\n"); cout << (int) c << endl; cout << static_cast (c) << endl;
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:
1. A) Assume that the user input for x is 25. What will be the value of x after the following code is executed?
if (x < 100)
{
x = x + 5;
}if (x < 500)
{
x = x - 2;
}
if (x > 10)
{ x++;
}
else
{
x--;
}
B) How can you improve the following code structure?
if (score < 40)
{
}
else if (score >= 40 || score < 50)
{
} else if (score >= 50 || score < 60)
{
}else if (score >= 60 || score < 70)
{
} else if (score >= 70 || score < 80)
{
}
else {
}
C) What will be printed on the console?
char c = '0';
if(c > 90) ;
cout << "The value of C is greater than 90\n");
cout << (int) c << endl;
cout << static_cast<int> (c) << endl;

Step by step
Solved in 3 steps with 1 images









