csce final questions with complete solutions
'\n' is two characters. Correct Answer False
A function that is associated with an object is called a ________
function. Correct Answer member
A stub is a function that is completely defined and well tested.
Correct Answer False
A two dimension array can also be thought of as Correct
Answer an array of arrays
A void function can be used in an assignment. Correct Answer
False
A void function can return any value. Correct Answer False
A void function may not be used in an output statement. Correct
Answer True
Arrays can be passed to functions. Correct Answer True
Arrays can be returned from a function. Correct Answer False
Call-by-reference parameters are passed Correct Answer the
actual argument
Data that is sent to an output stream representing a file will be
immediately saved to disk. Correct Answer False
, Functions can return at most one value. Correct Answer True
Given the following function definition for a search function,
and the following variable declarations, which of the following
are appropriate function invocations?
const int SIZE=1000;
int search(const int array[], int target, int numElements);
Correct Answer result=search(array, target,
numberOfElements);
Given the function definition
void something ( int a, int& b )
{
int c;
c = a + 2;
a = a * 3;
b = c + a;
}
what is the output of the following code fragment that invokes
something?
(All variables are of type int.)
r = 1;
s = 2;
t = 3;
something(t, s);
cout << r << ' ' << s << ' ' << t << endl; Correct Answer 1 14 3
If a file did not open correctly, you should Correct Answer
display an error message and take some suitable action such as
exit.
'\n' is two characters. Correct Answer False
A function that is associated with an object is called a ________
function. Correct Answer member
A stub is a function that is completely defined and well tested.
Correct Answer False
A two dimension array can also be thought of as Correct
Answer an array of arrays
A void function can be used in an assignment. Correct Answer
False
A void function can return any value. Correct Answer False
A void function may not be used in an output statement. Correct
Answer True
Arrays can be passed to functions. Correct Answer True
Arrays can be returned from a function. Correct Answer False
Call-by-reference parameters are passed Correct Answer the
actual argument
Data that is sent to an output stream representing a file will be
immediately saved to disk. Correct Answer False
, Functions can return at most one value. Correct Answer True
Given the following function definition for a search function,
and the following variable declarations, which of the following
are appropriate function invocations?
const int SIZE=1000;
int search(const int array[], int target, int numElements);
Correct Answer result=search(array, target,
numberOfElements);
Given the function definition
void something ( int a, int& b )
{
int c;
c = a + 2;
a = a * 3;
b = c + a;
}
what is the output of the following code fragment that invokes
something?
(All variables are of type int.)
r = 1;
s = 2;
t = 3;
something(t, s);
cout << r << ' ' << s << ' ' << t << endl; Correct Answer 1 14 3
If a file did not open correctly, you should Correct Answer
display an error message and take some suitable action such as
exit.