Skip to content
VUBuddy

CS304P Quiz 3

Object Oriented Programming (Practical) PDF 846 KBUpdated 23 Oct 2026
Quiz CS304P Quiz 3 PDF 846 KB
vubuddy.com
Type
Quiz
Course
CS304P Object Oriented Programming (Practical)
Size
PDF 846 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 846 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 of 2. Download the file for all 2 pages.

Q1. What will be the output of the following program? #include<iostream> using namespace std; class House{ private: int rooms; public: House() { cout<<"Entering the house"<<endl;} House(int R) { rooms = R;} ~House() { cout<<"Leaving the house"<<endl;} }; class Kitchen : public House { double size; public: Kitchen() : House() { cout<<"Entering the kitchen";} }; int main() { Kitchen Obj; return 0; }

  1. Entering the kitchen Entering the house Leaving the house
  2. Entering the house Entering the kitchen Leaving the house
  3. Entering the house Leaving the house Entering the kitchen
  4. Leaving the house Entering the house Entering the kitchen

Correct answer: Entering the house Entering the kitchen Leaving the house

Q2. Which of the following is unary operator in C++?

  1. *
  2. ++
  3. -
  4. +

Correct answer: ++

Q3. Which of the following is not the correct type of inheritance in C++?

  1. private
  2. public
  3. protected
  4. secret

Correct answer: secret

Q4. Consider the code below, class class1{ public: void func1(); }; class class2 : public class1 { }; Function func()1 of class1 is ______ in class2.

  1. Public
  2. Private
  3. Protected
  4. Hidden

Correct answer: Public

Q5. "cin" is an object of ____ class.

  1. ostream
  2. istream
  3. fstream
  4. instream

Correct answer: istream

Q6. For the given class definition, which one is correct? #include<iostream> using namespace std; class A{ int x,y; public: int Add(int a,int b){return a+b;} int Add(int c){return c;} };

  1. Function Add is overridden
  2. Function Add is overloaded
  3. None of the given options
  4. Function Add has an error

Correct answer: Function Add is overloaded

Q7. What will be the output of following C++ code? int a=5; cout<<a++;

  1. a
  2. 0
  3. 6
  4. 5

Correct answer: 5

Q8. Which of the following is correct symbol of stream extraction operator?

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

Correct answer: >>

Q9. If the programmer does not specify the type of inheritance then the default type of inheritance is

  1. None of the given
  2. Public
  3. Private
  4. Protected

Correct answer: Private

Q10. In case of public inheritance between Base class A and Derived class B, which of the folllowing data members of Base class will be hidden in Derived class?

  1. private
  2. both public and private
  3. protected
  4. public

Correct answer: private

All CS304P files →
CS304P Object Oriented Programming (Practical) All CS304P 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.