Forum

CS304 Quiz 2 Soluti...
 
Notifications
Clear all

[Solved] CS304 Quiz 2 Solution


admin
Posts: 978
Admin
Topic starter
(@shahzain)
Member
Joined: 2 years ago

 

CS304 Quiz 2 Solved

 

1) Which of the following is an example of unary operator

  1. Inequality Operator (! =)
  2. Division Operator (/)
  3. Increment Operator (++)
  4. Equality Operator (==)

 

2) In C++, which of the following is defined as stream insertion operator

  1. *<
  2. >>
  3. *>
  4. <<

 

3) Which of the following can be used as an alternative to static members

  1. Global Variables
  2. Constant Variables
  3. Array of Objects
  4. 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

  1. “Student obj;
  2. Student &obj;
  3. Student” obj;
  4. Student obj;

 

5) Identify which of the following overloaded operator function’s declaration is appropriate for the given call

  1. Operator+ (double& obj);
  2. Rational number operator+ (Rational number & obj. double& num);
  3. Rational number operator+ (Rational number & obj);
  4. None of the given choices

 

6) ______ remain in memory even when all objects of a class have been destroyed.

  1. Static Data Members
  2. Constant Data Members
  3. Primitive Variables
  4. Instance Data Members

 

7) In composition _______ are called from composing objects to composed objects.

  1. Member Functions
  2. Pointers
  3. Destructors
  4. Constructors

 

8) Composition is _______ and aggregation is __________ relationship.

  1. Weak, Weak
  2. Strong, Weak
  3. Weak, Strong
  4. Strong, Strong

 

9) In which of the following OOP paradigm objects can exist independently

  1. Inheritance
  2. Composition
  3. Aggregation
  4. Polymorphism

 

10) What is the general syntax of overloading Unary Operator as member function of the class

  1. TYPE & operator OP (TYPE &);
  2. TYPE & operator OP ();
  3. TYPE & operator OP (int);
  4. TYPE & operator OP (TYPE&, TYPE&);

 

Topic Tags
Share:
Scroll to Top