This document contains a quiz for a Programming and Data Structures II course. The quiz contains 40 multiple choice questions testing knowledge of key concepts in C++ including:
- The creator of the C++ language (Bjarne Stroustrup)
- Inheritance allows classes to derive from other classes and include their members
- New and delete operators allocate and free memory
- Function overloading changes functions based on argument types/numbers
- Operators like :: cannot be overloaded in C++
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
0 ratings0% found this document useful (0 votes)
129 views41 pages
QUIZ - I Computer
This document contains a quiz for a Programming and Data Structures II course. The quiz contains 40 multiple choice questions testing knowledge of key concepts in C++ including:
- The creator of the C++ language (Bjarne Stroustrup)
- Inheritance allows classes to derive from other classes and include their members
- New and delete operators allocate and free memory
- Function overloading changes functions based on argument types/numbers
- Operators like :: cannot be overloaded in C++
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 41
PARISUTHAM INSTITUTE OF TECHNOLOGY
AND SCIENCE DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS 6301 PROGRAMMING AND DATA STRUCTURES II
QUIZ I
1. Who is father of C++ Language?
A. Dr. E.F. Codd B. James A. Gosling C. Bjarne Stroustrup D. Dennis Ritchie
2. _________ allows to create classes
which are derived from other classes, so that they automatically include some of its "parent's" members, plus its own members. A. Overloading B. Inheritance C. Polymorphism D. Encapsulation
3. Important advantage of using new
and delete operators in C++ is A. Allocation of memory B. Frees the memory previously allocated C. Allocation of memory and frees the memory previously allocated D. Initialization of memory easily
4. Which of the following correctly
describes overloading of functions? A. Virtual polymorphism B. Transient polymorphism C. Ad-hoc polymorphism D. Pseudo polymorphism
5. Which of the following operators can
not be overloaded in C+ +? A. * B. == C. += D. ::
6. What is a size of empty class in c+
+? A. 4 bytes B. 2 bytes C. 0 bytes D. 1 bytes
7. In c++ object of the class is also
called? A. Constants B. Tag C. Instance D. Data collection
8. ________ is a default access specifier
for members of class in C++. A. protected B. public C. private D. default
9. In object oriented programming, by
wrapping up characteristics and behavior into one unit, we achieve A. Data Abstraction B. Data Encapsulation C. Data Hiding D. All of these
10. The mechanism that binds code
and data together and keeps them secure from outside world is known as A. Abstraction B. Encapsulation C. Inheritance D. Polymorphism
11. A Class can have how many
destructor? A. 1 B. 2 C. 3 D. 4
12. The parameter list in function
overloading must differ by? A. Number of functions B. Function Size C. Function Name D. Number of argument
13. Data members is also called?
A. Attribute B. Method C. Class D. Object
14. In how many ways is
polymorphism achived in C++? A. 2 B. 3 C. 1 D. 4
15. The Object is not declared for
which class? A. Parent B. Base C. Abstract D. Derived
16. The constructor without parameter
is called? A. Method Constructor B. Default Constructor C. Operator Constructor D. Function Constructor
17. The static member variable is
initialized to? A. 0 B. 1 C. 2 D. -1
18. Which of the following is user
defined data type? A. Public B. Private C. Class D. A & B Both
19. A __________ is a special method
used to initialize the instance variable of a class. A. Member function B. Destructor C. Constructor D. Structure
20. Member of a class specified as
_______ are accessible only to method of the class. A. private B. public C. protected D. derive
21. The goal of operator overloading is
__________. A. To help the user of a class B. To help the developer of a class C. To help define friend function D. None of the above
22. What features make C++ so
powerful? A. Easy implementation B. Code reusability C. Easy memory management D. All the above
23. Local Variables can be access ?
A. Code block enclosed in braces { }. B. Code block enclosed in bracket (). C. Code block enclosed in square bracket []. D. None of the above
24. Global Variables can be access ?
A. Anywhere in the code except inside functions. After it's declaration. B. Anywhere in the code, even inside functions. After it's declaration. C. Nowhere in the code D. None of the above
25. In C++ every statement end with?
A. Colon (:) B. Comma (,) C. Dot (.) D. None of the above
26. What is pointer?
A. The variable that stores the reference to another variable B. The variable that stores reference of garbage variable C. The variable that stores the memory address of another variable D. A & C Both
27. If class A inherits from more than
one class, ie. A inherits from B1, B2,... is called A. Single Inheritance B. Multilevel Inheritance C. Multiple Inheritance D. None of the above
28. If class A inherits from class B,
then B is called _______ of A. A is called ________ of B. A. Super class, Sub class B. Subclass, Super class C. Abstract class, Base Class D. Child class, Sub Class
29. ________ is the mechanism which
allows a class A to inherit properties of a class B. A. Data abstraction B. Encapsulation C. Inheritance D. Polymorphism
30. Which of the following statements is
correct? A. First time method of a class is called, the constructor method is called. B. Every time method of a class is called, the constructor method is called. C. Every time an instance of a class is created, the constructor method is called. D. None of the above
31. Ability to take many forms is called
________. A. inheritance B. polymorphism C. encapsulation D. member function
32. The run time system performs
__________ on virtual functions. A. Static binding B. additional error checking C. dynamic binding D. no special services
33. A _____________ pointer can point to
____________ object. A. derived class, base class B. void, derived class C. void, NULL D. base class, derived class
34. A virtual function is a member
function that expects to be _________ in a derived class. A. private B. none of these C. overridden D. called frequently
35. For proper display of
polymorphism, a method in the base class must be declared _______. A. private B. public C. protected D. virtual
36. The major goal of inheritance in C+
+ is A. To facilitate the conversion of data types B. To help modular programming C. To facilitate there usabilityof code D. To extend the capabilities of a class
37. The process of giving special
meaning to an operator is A. Operator overloading B. Operator mechanism C. Operator definition D. None of the above
38. The binding of a function call at
runtime is A. Static binding B. Early binding C. Late binding D. Runtime binding
39. With in .scope class
member may be referenced simply by their names A. classs B. objects C. program D. none of the above
40. A class that acts only as a base
class and is not used to create objects is A. parent class B. super class C. abstract class D. none of the above