What is the value of C++ expression 5 * 4 - 6 * 3 - 9?
What is the value of C++ expression 9/4 + 1?
Function g is defined below. What is the value of expression g(3)?
int g(int n) { if(n > 3) return 0; else return 2*n+3; }Answer
Using function g from the preceding exercise, what is the value of expression g(g(3))?
Suppose that variable y, of type double, already exists and has a value. Write a statement or sequence of statements that (1) creates a variable called frame of type double, and (2) makes frame hold value (y2 - 7y + 4)/9. Be sure to use C++ notation correctly. The expression shown is not in C++ notation, but in standard mathematical notation. Answer
Suppose that variable u has type double, and has already been given a value. Write a statement or statements that create variable m, of type double, and make m hold the absolute value of u. For this exercise, do not use the C++ abs function, or any close relative of it. (The absolute value of 4.0 is 4.0, and the absolute value of -4.0 is 4.0.) Answer
Using your solution to the preceding exercise, write a definition of function absoluteValue(u), where u has type double. It should return the absolute value of u. Answer