CS304 Quiz 2 Solved
1) Which of the following is an example of unary operator
- Inequality Operator (! =)
- Division Operator (/)
- Increment Operator (++)
- Equality Operator (==)
2) In C++, which of the following is defined as stream insertion operator
- *<
- >>
- *>
- <<
3) Which of the following can be used as an alternative to static members
- Global Variables
- Constant Variables
- Array of Objects
- Local Variables
4) Suppose we have a class named “Student”; which of the following statement is correctly declaring the pointer of the object for “Student” class
- “Student obj;
- Student &obj;
- Student” obj;
- Student obj;
5) Identify which of the following overloaded operator function’s declaration is appropriate for the given call
- Operator+ (double& obj);
- Rational number operator+ (Rational number & obj. double& num);
- Rational number operator+ (Rational number & obj);
- None of the given choices
6) ______ remain in memory even when all objects of a class have been destroyed.
- Static Data Members
- Constant Data Members
- Primitive Variables
- Instance Data Members
7) In composition _______ are called from composing objects to composed objects.
- Member Functions
- Pointers
- Destructors
- Constructors
8) Composition is _______ and aggregation is __________ relationship.
- Weak, Weak
- Strong, Weak
- Weak, Strong
- Strong, Strong
9) In which of the following OOP paradigm objects can exist independently
- Inheritance
- Composition
- Aggregation
- Polymorphism
10) What is the general syntax of overloading Unary Operator as member function of the class
- TYPE & operator OP (TYPE &);
- TYPE & operator OP ();
- TYPE & operator OP (int);
- TYPE & operator OP (TYPE&, TYPE&);