Skip to content
VUBuddy

CS304 Midterm Quizzes 2023 by Danish Hanif

Object Oriented Programming PDF 277 KBUpdated 23 Oct 2026
Midterm past paper CS304 Midterm Quizzes 2023 by Danish Hanif PDF 277 KB
vubuddy.com
Type
Midterm past paper
Course
CS304 Object Oriented Programming
Size
PDF 277 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 277 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 1, 2, 3 of 4. Download the file for all 4 pages.

Paid Services Available 10/10 Marks Guarantee · CS304 Quiz File · 6/7/2023 10:02:26 PM

Q1. _____ is creating objects of one class inside another class.

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

Q2. Which of the following is the correct syntax of declaring static variable “count” of type int?

  1. static int count;
  2. int static count;
  3. static count int;
  4. int count static;

Q3. _______ remain in memory even when all objects of a class have been destroyed.

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

Q4. What will be the output of the following code?

#include<iostream> using namespace std; int main() { int const x = 10; cout << ++x;

A. 11

B. 10

C. Compile time Error

D. Run Time Error

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

A. Complex operator +(const Complex & rhs); B. operator + Complex (const Complex & rhs); C. Complex +(const Complex & rhs); D. Complex operator + ::(const Complex & rhs);

6) Suppose we have a class named “Student”; which of the following statement is correctly

declaring the pointer to the object for “Student” class?

  1. Select the correct option
  2. Student &obj;
  3. *Student obj;
  4. Student *obj;

Student obj;

  1. Choose the correct option to declare an overloaded stream insertion operator for a user- defined class " String" as a non-member friend function.

A. friend void operator << (const String & rhs); B. friend void & operator << (ostream & os); C. friend ostream & operator << (ostream & os, const String & s); D. friend ostream & operator << ();

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

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

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

  1. >>
  2. <<
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.