Skip to content
VUBuddy

CS304P Quiz 8

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

Q1. Which of the following members of base class can be accessed in the derived class?

  1. Both Protected and Public
  2. Both Protected and Private
  3. All (Public, Protected, and Private)
  4. Both Public and Private

Correct answer: All (Public, Protected, and Private)

Q2. What is the name of Base class in the line below? class Truck : public Vehicle

  1. Vehicle
  2. Public
  3. None of the given options
  4. Truck

Correct answer: Public

Q3. In the case of protected inheritance, public members of the base class will be _____________ in the derived class.

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

Correct answer: Protected

Q4. In the case of private inheritance, public members of the base class will be _____________ in the derived class.

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

Correct answer: Protected

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

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

Correct answer: Public

Q6. What will be the output of the following program? #include<iostream> using namespace std; class FirstNumber { private: int x; public: int y; FirstNumber () { x = 0; y = 10; } }; class SecondNumber: public FirstNumber { int z; public: int w; SecondNumber () : FirstNumber () { z = 20; w = y + z; cout<<w;} }; int main() { SecondNumber Obj; return 0; }

  1. 10
  2. 40
  3. 20
  4. 30

Correct answer: 30

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.