CSCI 240 Final Test Questions with Verified
Correct Answers
an instance of a class is known as a/an
object
The various string functions that were discussed in lecture (strcpy, strcmp, etc...) are
contained in the _______ library
cstring
T/F
It is legal and acceptable to have two local variables in two different functions with the
same name and same datatype
True
What values are contained in array ar?
int ar[10] = { 2, 4, 6, 8, 10} ;
2 4 6 8 10 0 0 0 0 0
T/F
A function prototype is place before int main()
True
void fn( double &, double &)
double var1, var2
What is one possible calling statement for the fn function, using var1 and var2
fn (var1, var2);
, The two types of access methods that were discussed in class are _____ and _____
methods.
set and get
In an if/else statement, the code that follows the else statement is executed if the
condition is _______
false
double x = 3.1415, y = 9.8765;
double &ref = x;
ref = y;
what does the third line do?
Assign 9.8765 to x
what will the following for loop display?
int k;
for (k = 2, k <4, k++)
cout << k;
4
T/F
int array [] is a valid array declaration
false
Correct Answers
an instance of a class is known as a/an
object
The various string functions that were discussed in lecture (strcpy, strcmp, etc...) are
contained in the _______ library
cstring
T/F
It is legal and acceptable to have two local variables in two different functions with the
same name and same datatype
True
What values are contained in array ar?
int ar[10] = { 2, 4, 6, 8, 10} ;
2 4 6 8 10 0 0 0 0 0
T/F
A function prototype is place before int main()
True
void fn( double &, double &)
double var1, var2
What is one possible calling statement for the fn function, using var1 and var2
fn (var1, var2);
, The two types of access methods that were discussed in class are _____ and _____
methods.
set and get
In an if/else statement, the code that follows the else statement is executed if the
condition is _______
false
double x = 3.1415, y = 9.8765;
double &ref = x;
ref = y;
what does the third line do?
Assign 9.8765 to x
what will the following for loop display?
int k;
for (k = 2, k <4, k++)
cout << k;
4
T/F
int array [] is a valid array declaration
false