Cpp Programming 3

COEP
Lets Crack Online Exam

IT Interview Exam Questions: Cpp Programming 3 (IT Interview Exam Question, IT Campus Placement)

Subject: Cpp Programming 3

Part 3: List for questions and answers of C ++ Language

 

Q1. Which of the following is false with respect to inheritance?

a) When a base class is privately inherited,public members of base become private members of the derived

b) When a base class is publicly inherited,public members of base becomes public members of derived

c) When a base class is privately inherited,a private member of base becomes private member of derived

d) When a base class is publicly inherited protected members of base becomes protected members of derived

 

Q2. Which of the following is/are false

a) Inheritance is deriving new class from existing class

b) In an inheritance, all data and function members of base class are derived by derived class

c) We can specify which data and function members of base class will be inherited by derived class

d) We can add new functions to derived class without recompiling the base class

 

Q3. A base class will offer

a) offer more specific objects than its derived classes

b) correspond to something in the rest world

c) behave badly when the chops are down

d) be a generalized version of its derived classes

 

Q4. If a base class member access is public, and an inherited class accesses specifier is private, which of the following statement is true ?

a) The base class member can be accessed by derived class objects

b) The base class members cannot be accessed by the derived class members

c) The derived class members can be accessed by the base class objects

d) None of above

 

Q5. Choose most appropriate statement

a) An abstract base class can have pure virtual destructor

b) An abstract base class can have only virtual destructor

c) An abstract base class can have non virtual destructor

d) An abstract base class cannot have destructor 

 

Q6. The conversion from basic data to class type can be done by …….

a) Writing constructor

b) Is not possible

c) overloaded casting operator

d) object of a class

 

Q7. When a base class pointer points to derived class object?

a) It can access only base class members

b) It can access only derived class members

c) Both base class and derived class members

d) None

 

Q8. What is meant by multiple inheritance?

a) Deriving a base class from derived class

b) Deriving a derived class from base class

c) Deriving a derived class from more than one base class

d) None of the mentioned

 

Q9. Which symbol is used to create multiple inheritance?

a) Dot

b) Comma

c) Dollar

d) None of the mentioned

 

Q10. what is Hybrid Inheritance?

a) multiple inheritance

b) multilevel inheritance

c) multipath inheritance

d) combination of a and b

 

Q11. Which design patterns benefit from the multiple inheritance?

a) Adapter and observer pattern

b) Code pattern

c) Glue pattern

d) None of the mentioned

 

Q12. What does inheriatance allows you to do?

a) create a class

b) create a hierarchy of classes

c) access methods

d) None of the mentioned 

 

Q13. What is the syntax of inheritance of class?

a) class name

b) class name : access specifer

c) class name : access specifer class name

d) None of the mentioned

 

Q14. How many types of inheritance are there in c++?

a) 2

b) 3

c) 4

d) 5

 

Q15. What is meant by containership?

a) class contains objects of other class types as its members

b) class contains objects of other class types as its objects

c) both a and b

d) none of the mentioned

 

Q16. How many types of constructor are there in C++?

a) 1

b) 2

c) 3

d) 4

 

Q17. Which design patterns benefit from the multiple inheritance?

a) Adapter and observer pattern

b) Code pattern

c) Glue pattern

d) None of the mentioned

 

Q18. What is meant by polymorphism?

a) class having many forms

b) class having only single form

c) class having two forms

d) none of the mentioned

 

Q19. What does derived class does not inherit from the base class?

a) constructor and destructor

b) friends

c) operator= () members

d) all of the mentioned 

 

Q20. What are the things are inherited from the base class?

a) Constructor and its destructor

b) Operator=() members

c) Friends

d) All of the mentioned 

 

Part 3: List for questions and answers of C ++ Language

 

Q1. Answer: c

 

Q2. Answer: b

 

Q3. Answer: d

 

Q4. Answer: a

 

Q5. Answer: d

 

Q6. Answer: a

 

Q7. Answer: a

 

Q8. Answer: c

 

Q9. Answer: b

 

Q10. Answer: d

 

Q11. Answer: a

 

Q12. Answer: b

 

Q13. Answer: c

 

Q14. Answer: d

 

Q15. Answer: a

 

Q16. Answer: c

 

Q17. Answer: a

 

Q18. Answer: a

 

Q19. Answer: d

 

Q20. Answer: d