CSCE 1337 261 SP24 - Object Oriented
Programming 100% Verified
Call-by-reference should be used - ANSWER When the function needs to change the
value of one or more arguments
The following is legal in a void function - ANSWER True
Testing your program should be done - ANSWER As each function is developed
It is illegal to call other functions from inside a function definition. - ANSWER False
When a void function is called, it is known as - ANSWER an executable statement.
If you write a function that should use call-by-reference, but forget to include the
ampersand - ANSWER The program will run with incorrect results
A void function may not be used in an output statement. - ANSWER True
It is acceptable to have both call-by-value and call-by-reference parameters in the same
function declaration. - ANSWER True
What is wrong with the following code?int f1( int x, int y){ x = y * y; return x;int f2( float a,
float& b){ if(a < b) b = a; else a=b; return 0.0;}} - ANSWER Function definitions may not
be nested.
In a function with call-by-reference parameters, any changes to the formal parameters
will change the actual arguments passed to the function. - ANSWER True
Programming 100% Verified
Call-by-reference should be used - ANSWER When the function needs to change the
value of one or more arguments
The following is legal in a void function - ANSWER True
Testing your program should be done - ANSWER As each function is developed
It is illegal to call other functions from inside a function definition. - ANSWER False
When a void function is called, it is known as - ANSWER an executable statement.
If you write a function that should use call-by-reference, but forget to include the
ampersand - ANSWER The program will run with incorrect results
A void function may not be used in an output statement. - ANSWER True
It is acceptable to have both call-by-value and call-by-reference parameters in the same
function declaration. - ANSWER True
What is wrong with the following code?int f1( int x, int y){ x = y * y; return x;int f2( float a,
float& b){ if(a < b) b = a; else a=b; return 0.0;}} - ANSWER Function definitions may not
be nested.
In a function with call-by-reference parameters, any changes to the formal parameters
will change the actual arguments passed to the function. - ANSWER True