COP 3330 FINAL EXAM (MYERS) QUESTIONS WITH
CORRECT ANSWERS
Object -ANSWER-Name -- the variable name we give it
Member data
Member functions
Class -ANSWER-a blueprint for objects
function -ANSWER-return type
name
parameter list
pass by reference -ANSWER-
pass by value -ANSWER-creates copy
changes will not affect the originals
friend functions -ANSWER-class Fraction {
friend bool functionname(parameter 1);
public:
private:
}
, L-values -ANSWER-represents an object that has an address location in memory
R-values -ANSWER-represents an object that does not have an address location in memory
object passed by value -ANSWER-a copy is made of the object. Any R-value can be sent on
the call
object passed by reference -ANSWER-(without const) no copy is made, and only an L-value
can be sent on the call
bool Fraction::Equals() -ANSWER-returnType className::memberFunction()
returning objects from member functions -ANSWER-Fraction newFracObj(num, denom); //
creates
return newFracObj; //then returns
OR
return Fraction(num, denom); //creates and returns
A const object may only call: -ANSWER-const member functions
static member data -ANSWER-
const member data -ANSWER-
binary operators -ANSWER-2 operands
+,=,*,/,==,>= etc...
CORRECT ANSWERS
Object -ANSWER-Name -- the variable name we give it
Member data
Member functions
Class -ANSWER-a blueprint for objects
function -ANSWER-return type
name
parameter list
pass by reference -ANSWER-
pass by value -ANSWER-creates copy
changes will not affect the originals
friend functions -ANSWER-class Fraction {
friend bool functionname(parameter 1);
public:
private:
}
, L-values -ANSWER-represents an object that has an address location in memory
R-values -ANSWER-represents an object that does not have an address location in memory
object passed by value -ANSWER-a copy is made of the object. Any R-value can be sent on
the call
object passed by reference -ANSWER-(without const) no copy is made, and only an L-value
can be sent on the call
bool Fraction::Equals() -ANSWER-returnType className::memberFunction()
returning objects from member functions -ANSWER-Fraction newFracObj(num, denom); //
creates
return newFracObj; //then returns
OR
return Fraction(num, denom); //creates and returns
A const object may only call: -ANSWER-const member functions
static member data -ANSWER-
const member data -ANSWER-
binary operators -ANSWER-2 operands
+,=,*,/,==,>= etc...