CS304 Solved Quiz 1 2021 by Elon Musk
- Type
- Quiz
- Course
- CS304 Object Oriented Programming
- Size
- PDF 1.7 MB
- 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 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.
- 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?
- Choose correct declaration of overloaded inequality (!=) operator for class String as non- member friend function. None of the given options
- 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() {//...
- The sub-object’s life is not dependent on the life of master class in ___________. Aggregation
- Hiding the implementation details makes program: Easy to understand
- 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.
- Deconstruct is a function which has the same name as that of class but starts with a—– sign
- 'this' pointer cannot be passed implicitly to __________ functions. Static Member
Q14. Which of the following can be the behavior of an object “Usman”?
Eat
- In Object Oriented programming, objects communicate with each other through
Messages
- Constructor is used to______the objects of a class. Initialize
Q17. Which of the following is NOT an access specifier in C++?
Hidden
- 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.
- In case when we define the function outside the class then we must use the keyword _________ to make the function inline. Inline
- In constant member function the type of this pointer is: Constant pointer to constant data
- In ____________, base class can be replaced by the derived class. Extension
- We can get the address of a variable stored in a pointer using __________: & symbol
- 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 ();
- _____ is creating objects of one class inside another class.
Related CS304 files
All CS304 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.