Object-Oriented Programming Quiz Solved. Recent CS304 Quiz 1 Solution for Help in Studies or Exams and Improve Knowledge or Learning Skills. Also, Get PDF File Given Below.
CS304 QUIZ 1 SOLVED
1. Suppose we have defined derived class copy constructor but have not defined base class copy constructor then compiler will.
a) Use base class default constructor
b) Generate base class copy constructor itself
c) Use base class assignment operator
d) None of the options is correct
2. In the case of dynamic memory allocation in our class we should use
a) Default assignment operator
b) User-defined assignment operator
c) Default Copy constructor
d) None of these
3. The C++ code statement class A: public B shows ___ relationship.
a) Aggregation
b) Composition
c) Inheritance
d) Simple Association
4. Which of the following is TRUE.
a) Derived class pointer can be used as Base class pointer
b) Base class pointer can be used as derived class pointer
c) Both of these options
d) None of these options
5. Public Inheritance represents.
a) “IS A” relationship
b) “Has A” relationship
c) “IS Special Kind of” relationship
d) None of these options
6. In protected Inheritance the public members of base class become ___ in derived class.
a) Public
b) Private
c) Protected
d) None of the given options
7. Static casting is
a) C++ way of calling base class functions from derived class
b) C way of calling base class functions from derived class.
c) Both of these
d) None of these
8. Sender of the message does not need to know the exact class of receiver in ___.
a) Abstraction
b) Polymorphism
c) Inheritance
d) none of the given
9. When we want to implement one class in terms of another class then we use.
a) public inheritance
b) protected inheritance
c) private inheritance
d) none of these options
10. In case of public inheritance, protected members of base class will be ___ in derived class?
a) private
b) public
c) protected
d) hidden
11. Child class can call constructor of its,
a) Direct base class
b) Indirect base class
c) Both direct and indirect base classes
d) None of these
12. Suppose Person is a user defined class, In statement “Person” pPtr”, static type of pPtr is ___.
a) pPtr
b) Pointer
c) Person
d) None of the given
13. Which of the following types of inheritance is used to model “Implemented in terms of” relationship?
a) Public
b) Private
c) Protected
d) Confidential
14. Two functions with same names, parameters and return type can exist in.
a) Function overloading
b) Function overriding
c) Operator overloading
d) None of these options
15. A class with no pure virtual function is a ___ class
a) Concrete
b) Abstract
c) Virtual
d) None of above
16. In case of public inheritance, protected members of base class will be ___ in derived class?
a) private
b) public
c) protected
d) hidden
17. A parent class can call constructor of its child class through,
a) Its constructor initialization list
b) Its constructor body
c) Both from its constructor initialization list or body
d) Can not cell the constructor of its child class
18. A function call is resolved at run-time in ___.
a) non-virtual member function
b) virtual member function
c) Both non-virtual member and virtual member function
d) None of given
19. Friend functions of a class are ___ members of that class.
a) Public
b) Private
c) Protected
d) None of the given options
20. Consider the code below,
class class1{
public:
void func1();
};
class class2:private class1{
};
Function func1 of class1 is __ in class2,
a) public
b) protected
c) private
d) none of the given options
Check Also Important Materials:
CS304 Past Papers Midterm Solved by Moaaz
Share with fellows to get easily help in studies.
0 Comments