Skip to content
VUBuddy

CS304 Quiz 2 by VU Topper RM

Object Oriented Programming PDF 528 KBUpdated 23 Oct 2026
Quiz CS304 Quiz 2 by VU Topper RM PDF 528 KB
vubuddy.com
Type
Quiz
Course
CS304 Object Oriented Programming
Size
PDF 528 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 528 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 2, 3, 4 of 12. Download the file for all 12 pages.

Which of the following best describes relationship between Book and BookChapter classes?

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

Correct answer: Composition

The keyword "friend" should be placed in ___________ : A. Main Function B. Function Definition C. Anywhere in program

D. Function Declaration Google

Which of the following stores the address of a variable?

  1. Pointer
  2. Function
  3. Destructor
  4. Constructor

Correct answer: Pointer

_____ is creating objects of one class inside another class. A. Association B. Inheritance C. Aggregation

D. Composition Page 125

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

  1. Local Variables
  2. Array of Objects
  3. Global Variables
  4. Constant Variables

Correct answer: Global Variables

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

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

Correct answer: TYPE & operator OP ();

Which of the following operators operate on one operand?

  1. Unary Operators
  2. Ternary Operator
  3. Binary Operators
  4. All of the given options

Correct answer: Unary Operators

Composition is __________ and aggregation is ____________ relationship. A. Weak, Weak B. Weak, Strong

C. Strong, Weak

D. Strong, Strong

Which of the following function declaration is correct to overload the + operator as member function in Complex class?

  1. Complex +(const Complex & rhs);
  2. operator + Complex (const Complex & rhs);
  3. Complex operator +(const Complex & rhs);
  4. Complex operator + ::(const Complex & rhs);

Correct answer: Complex operator +(const Complex & rhs);

Insertion operator is ________________ associative. A. Left to Left B. Right to Left

C. Left to Right Page 160

D. Right to Right

Which of the following statement is TRUE about a class's Static Member Function?

  1. It can access non-static data members.
  2. It is used to access static data members only.
  3. It can only be called by a particular object of class.
  4. It can access constant data members of the class.

Correct answer: It is used to access static data members only.

Which of the following is the correct way of declaring a constant variable named RollNo?

  1. const RollNo;
  2. int const rollNo;
  3. int RollNo const;
  4. const int RollNo;

Correct answer: const int RollNo;

Which of the following is defined as stream extraction operator in C++?

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

Correct answer: >> Page 158

What will be the output of the following code? #include<iostream> using namespace std; int main()

int const x = 10;cout << ++x;}

A. 10

B. Run Time Error C. 11 D. Compile time Error

In C++, the subscript operator [] must be overloaded as a _______ of the class, with one parameter of _______ type.

A. Member function, int Google

B. Member function, char

All CS304 files →
CS304 Object Oriented Programming All CS304 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.