- Type
- Quiz
- Course
- CS304P Object Oriented Programming (Practical)
- Size
- PDF 845 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
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?
Correct answer: All (Public, Protected, and Private)
Q2. What is the name of Base class in the line below? class Truck : public Vehicle
Correct answer: Public
Q3. In the case of protected inheritance, public members of the base class will be _____________ in the derived class.
Correct answer: Protected
Q4. In the case of private inheritance, public members of the base class will be _____________ in the derived class.
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.
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; }
Correct answer: 30
Related CS304P files
All CS304P files →Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.