Skip to content
VUBuddy

CS304 Solved Quiz 1 2021 by Elon Musk

Object Oriented Programming PDF 1.7 MBUpdated 23 Oct 2026
Quiz CS304 Solved Quiz 1 2021 by Elon Musk PDF 1.7 MB
vubuddy.com
Type
Quiz
Course
CS304 Object Oriented Programming
Size
PDF 1.7 MB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 1.7 MB

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 63. Download the file for all 63 pages.

CS304 Quiz #1 by

Q1. Suppose derived class is inherited from base class. What happens when a derived class object is created?

The constructor of base class is executed before the constructor of derived class.

  1. Suppose str1, str2 and str3 are objects of class String. Choose appropriate declaration of str1 = str2 = str3;

Q3. In C++, which of the following is defined as stream insertion operator?

  1. Choose correct declaration of overloaded inequality (!=) operator for class String as non- member friend function. None of the given options
  2. Relationship in which child object gets destroyed if parent object is destroyed.

Q6. How the information hidden within an object can be accessed?

Through its interface

Q7. Which of the following defines default constructor for class "Student"?

Student() {//...

  1. The sub-object’s life is not dependent on the life of master class in ___________. Aggregation
  2. Hiding the implementation details makes program: Easy to understand
  3. The functions defined inside the class are by default ________. Inline

Q11. Which of the following statement is TRUE about static function of a class?

It is used to access static data members.

  1. Deconstruct is a function which has the same name as that of class but starts with a—– sign
  2. 'this' pointer cannot be passed implicitly to __________ functions. Static Member

Q14. Which of the following can be the behavior of an object “Usman”?

Eat

  1. In Object Oriented programming, objects communicate with each other through

Messages

  1. Constructor is used to______the objects of a class. Initialize

Q17. Which of the following is NOT an access specifier in C++?

Hidden

  1. The other name of subtyping is ________. Extension

Q19. Suppose a class does not have any constructor. What will happen when an object of this class is created?

Compiler will call implicit default constructor.

  1. In case when we define the function outside the class then we must use the keyword _________ to make the function inline. Inline
  2. In constant member function the type of this pointer is: Constant pointer to constant data
  3. In ____________, base class can be replaced by the derived class. Extension
  4. We can get the address of a variable stored in a pointer using __________: & symbol
  5. A child inherits characteristics from its _________. Parent

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

Complex operator +(const Complex & rhs);

Q26. Which of the following is not true about constant member function?

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

TYPE & operator OP ();

  1. _____ is creating objects of one class inside another class.
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.