OOPortal
SiteMap
Reusable Software
Structured Programming
Ad Hoc Polymorphism
«Prev
Reusable Code
Polymorphism Concept
Comparing Conversion Operators
ADT Conversion
Conversion Member Functions
Signature Matching Algorithm
Operator Overloading
Unary Binary Overloading
friend Function Usage
friend Function - Quiz
Overloading Operators
Pure Polymorphism
public Inheritance - Quiz
Virtual Function - Exercise
Pure Polymorphism
Ecological Simulation
ADT Conversions Constructor - Quiz
1.
Explicit cast conversion is necessary:
A.
anytime an int needs to be converted to a double
B.
anytime any native type needs to be converted to another native type
C.
anytime a user-defined type is used as an argument to a function
D.
when the implicit conversion is not desired or expression is illegal otherwise
2.
A constructor is a conversion constructor if:
A.
it takes two arguments: the "from-type" and "to-type"
B.
it has only one "from-type" argument and the "to-type" is implied
C.
it takes either two arguments or it takes only the "from-type" argument
D.
the constructor has no arguments and is made for you by the compiler
3.
To convert from a user-defined type to a built-in type, you must add a special conversion member function to the class. This member function must:
A.
use the operator keyword in its declaration
B.
be a static member function
C.
have a return type
D.
not have an empty argument list
Correct answers:
Your Score: 0
Submit
Quiz Explanation