1 consider the following class definition class rectangletype public void setlengthw 5346439
1.
Consider the following class definition
class rectangleType and the object declaration rectangleType bigRect(14,10); Which of the following statements is correct? (Points : 4) |
bigRect.setLengthWidth();
bigRect.setLengthWidth(3.0, 2.0);
bigRect.length = 2.0;
bigRect.length = bigRect.width;
2.
Which of the following base class members is never inherited by a derived class, regardless of access attributes? (Points : 4) |
Mutator
Data
Accessor
Destructor
3.
Which of the following prototype statements correctly overloads the modulo operator for an object of class Insect? (Points : 4) |
operator modulo (const Insect &);
operator %(const & Insect);
operator %(& Insect );
operator % (const Insect &);
4.
To overload the pre-increment (++) operator for a class, if the operator function is a member of that class, it must have ____ parameter(s). (Points : 4) |
0
1
2
3
5.
Virtual functions are reserved using what C++ keyword? (Points : 4) |
Polymorphic
Static
Dynamic
Virtual
6.
Which of the following are effective tools for managing software complexity? (Points : 4) |
Dynamic and static binding
Inheritance and polymorphism
Encapsulation and instantiation
Simulation and debugging
7.
With virtual functions and polymorphism, the programmer can (Points : 4) |
have all object definitions defined during compilation.
have all object definitions defined during linking.
have the object definitions defined during run-time.
explicitly define all class relationships in the program code.
8.
In a multi-file, object-oriented C++ project, which file contains the class definition? (Points : 4) |
classname.cpp
classname.h
classname.def
classname.hdr