BCA (Second Semester) Examination, July-2022
BCA-2001
Object Oriented Programming Using C++
Time : 1:30 Hours Maximum Marks-100
1. In object oriented Programming the program is divided into _________.
(A) Class
(B) Object
(C) Function
(D) None of these
2. Which one is the Object Oriented Programming language ?
(A) Cobol
(B) C
(C) C++
(D) Both C & C++
3. The wrapping up of data and functions into a single unit is called _________.
(A) Inheritance
(B) Encapsulation
(C) Data hiding
(D) Polymorphism
4. The process by which objects of one class acquire the properties of objects of
another class is called ______________.
(A) Abstraction
(B) Inheritance
(C) Encapsulation
(D) Polymorphism
5. In OOP which concept provides the idea of reusability :
(A) Inheritance
(B) Encapsulation
(C) Data hiding
(D) Polymorphism
6. The process of making an operator to exhibit different behaviours in different
instances is called ___________.
(A) Function overloading
(B) Operator overloading
(C) Inheritance
(D) None of these
7. The process of making a function to exhibit different behaviours in different
instances is called ____________.
(A) Function overloading
(B) Operator overloading
(C) Inheritance
(D) None of these
8. Objects communicate with one another by using ____________.
(A) Message passing
(B) Operator overloading
(C) Inheritance
(D) Both (A) & (B)
9. Through _____________ we can eliminate redundant code and extend the use of
existing class.
(A) Inheritance
(B) Operator overloading
(C) Encapsulation
(D) Both (A) & (B)
10. The __________ principle helps the programmer to build secure programs.
(A) Operator overloading
(B) Encapsulation
(C) Data hiding
(D) Polymorphism
11. What are the basic run time entities in an object oriented program ?
(A) Objects
(B) Functions
(C) Datas
(D) None of these
12. OOPs follows _______________ approach during program design.
(A) Top down
(B) Bottom-up
(C) Both (A) & (B)
(D) None of these
13. The technique of Hiding internal details in an object is called _________.
(A) Encapsulation
(B) Functions
(C) Abstraction
(D) Inheritance
14. Classes are ___________ datatype.
(A) Derived
(B) User-defined
(C) Built-in
(D) Both (A) & (C)
15. _______________ provides interface between the object’s data and program.
(A) Object
(B) Functions
(C) Class
(D) Polymorphism
16. _____________ refers to the linking of procedure call to the code to be executed in
response to the call. (A) Polymorphism
(B) Functions
(C) Dynamic binding
(D) Object
17. A _______________ for an object is a request for execution of a procedure.
(A) Object
(B) Functions
(C) Dynamic binding
(D) Message discuss
18. The << operator is known as ___________________.
(A) Put to
(B) Get from
(C) Insertion
(D) Both (A) & (C)
19. The >> operator is known as ________________.
(A) Put to
(B) Get from
(C) Extraction
(D) Both (B) & (C)
20. ______________ contains function prototype for the standard input and output
functions.
(A) iomanip.h
(B) iostream.h
(C) stdlib.h
(D) Both (A) & (B)
21. In C++ default return type for all the functions is _______________.
(A) Int
(B) Void
(C) Float
(D) None of these
22. The multiple use of input and output operator is called _____________.
(A) Polymorphism
(B) Inheritance
(C) Cascading
(D) None of these
23. Which of the following is not a feature of OOPs?
(A) Polymorphism
(B) Inheritance
(C) Dynamic binding
(D) None of these
24. By default, the members of a C++ class are :
(A) Private
(B) Public
(C) Protected
(D) None of these
25. Which of the following function that must contain in all C++ Programs :
(A) start()
(B) system()
(C) main()
(D) program()
26. Which one of the following is the correct operator to compare two values : (A) :=
(B) =
(C) Equal
(D) = =
27. C++ is originally developed by :
(A) Nicolas Wirth
(B) Dennis Ritchi
(C) Bjarne Stroustrup
(D) Ken Thompson 28. Identify the unary operator :
(A) ? , :
(B) ++
(C) +
(D) %
29. The ________ are used to check the relationship between two numeric operands or
expressions.
(A) Logical operators
(B) Relational operators
(C) Arithmetic operators
(D) Bitwise operators
30. ____________ is a function that is expanded in line when it is invoked.
(A) Library function
(B) User defined function
(C) Inline function
(D) None of these
31. The qualifier ___________ tells the compiler that the function should not modify
the argument. (A) Const
(B) Static
(C) Constant
(D) Inline
32. _________ refers to the use of the same thing for different purpose.
(A) Function declaration
(B) Overloading
(C) Function calling
(D) Prototyping
33. The functions declared inside the class is known as __________.
(A) Data members
(B) Library functions
(C) Member functions
(D) User defined functions
34. Calling a member function by using its name from another member function of the
same class is known as ___________.
(A) Grouping of member function
(B) Member function group
(C) Nesting of member function
(D) Nested group of member function
35. ________ function can only be called by another function that is a member of its
class.
(A) Member function
(B) Private member function
(C) Nested member function
(D) Public member function
36. ______________ are normally used to maintain values common to the entire class.
(A) Dynamic variables
(B) Static variables
(C) Private variables
(D) Public variables
37. A static variable is initialized to ___________ when the first object of its class is
created. (A) 1
(B) Null
(C) 0
(D) None of these
38. A function calling itself :
(A) Inline function
(B) Static function
(C) Friend function
(D) Recursion
39. Which of the following is not a type of constructor ?
(A) Copy constructor
(B) Friend constructor
(C) Default constructor
(D) Parameterized construct
40. Constructor is executed when ____________.
(A) An object is created
(B) An object is used
(C) A class is declared
(D) An object goes out of scope
41. Which of the following also known as an instance of a class ?
(A) Friend functions
(B) Object
(C) Member functions
(D) Member Variables
42. A constructor that accepts _________________ parameters is called the default
constructor. (A) One
(B) Two
(C) No
(D) Three
43. Destructor has the same name as the constructor and it is preceded by __________.
(A) !
(B) ?
(C) ~
(D) $
44. Which constructor function is designed to copy objects of the same class type ?
(A) Create constructor
(B) Object constructor
(C) Dynamic constructor
(D) Copy constructor
45. Which of the following statement is correct ?
(A) A constructor has the same name as the class in which it is present
(B) A constructor has a different name than the class in which it is present
(C) A constructor always returns an integer
(D) A constructor cannot be overloaded
46. A destructor takes _____________ arguments.
(A) One
(B) Two
(C) Three
(D) No
47. Destructor calls are made in which order of the corresponding constructor calls ?
(A) Reverse order
(B) Forward order
(C) Depends on how the object is constructe
(D) Depends on how many objects are constructed
48. Which allows you to create a derived class that inherits properties from more than
one base class ?
(A) Multilevel inheritance
(B) Multiple inheritance
(C) Hybrid inheritance
(D) Hierarchical inheritance
49. A derived class with only one base class :
(A) Multilevel inheritance
(B) Multiple inheritance
(C) Single inheritance
(D) Hierarchical inheritance
50. The duplication of inherited members due to the multiple paths can be avoided by
making a common base class is called :
(A) Abstract class
(B) Virtual base class
(C) Multiple inheritance
(D) Nesting of classes
51. The operators can’t be overloaded :
(A) Binary operators
(B) Unary operators
(C) Ternary operator
(D) None
52. A friend function for unary operator overloading takes _____________ arguments.
(A) Zero
(B) One
(C) Two
(D) None
53. A friend function for binary operator overloading takes ____________ arguments.
(A) Zero
(B) One
(C) Two
(D) None
54. The variable that contains the address of constant or variable :
(A) Function
(B) Array
(C) Pointer
(D) Structure
55. The memory management operator in c++ :
(A) New & delete
Malloc
Calloc
Free
56. The pointer refers to an object that has called the member function currently :
(A) This
(B) Address
(C) Virtual function
(D) None
57. The empty virtual function are called :
(A) Pure / do nothing
(B) Virtual table
(C) Polymorphism
(D) Virtual base class
58. A stream of byte that is the interface between IO and IO devices :
(A) Streams
(B) Class
(C) Object
(D) File
59. The class that derived from standard library ios contain input functions :
(A) Ios
(B) iostream
(C) istream
(D) ostream
60. The class that derived from standard library ios contain output functions :
(A) Ios iostream istream ostream
61. Which function is in the ostream class :
(A) get()
(B) read()
(C) write
(D) cin
62. Which function is in the istream class :
(A) get()
(B) put()
(C) write
(D) cout
63. The standard library inherited from istream & ostream :
(A) Ios
(B) iostream
(C) ifstream
(D) ofstream
64. The function used to receive one character at a time :
(A) get()
(B) put()
(C) getline()
(D) write()
65. The function used to display one character at a time :
(A) get()
(B) put()
(C) getline()
(D) write()
66. The function used to receive one line at a time :
(A) get()
(B) put()
(C) getline()
(D) write()
67. The function used to display one line at a time :
(A) get()
(B) put()
(C) getline()
(D) write()
68. __________ are the reserved words of the programming language.
(A) Tokens
(B) Literals
(C) Separators
(D) Keywords
69. __________ refer to the names of variables, functions, arrays, classes, etc.
(A) Identifiers
(B) Operators
(C) Punctuators
(D) Manipulators
70. Write the range of value of the data type ‘char’ :
(A) 0 to 128
0 to 255
-255 to 255
-128 to 127
71. A ____________ is the name of the storage location :
(A) Identifier
(B) Variable
(C) Keyword
(D) Token
72. Array indexing always starts with the number :
(A) 0
(B) 1
(C) 2
(D) \0
73. We declare a function with _____________ if it does not have any return type.
(A) Long
(B) Double
(C) Void
(D) Int
74. Which of the following is selection statement in C++ ?
(A) break
(B) goto
(C) exit
(D) switch
75. Which of the following is a correct comment ?
(A) */ Comments */
** Comment **
/* Comment */
{ Comment }
76. To increase the value of c by one which of the following statement is wrong ?
(A) c++;
(B) c = c + 1;
(C) c + 1 => c;
(D) c + = 1
77. When following piece of code is executed, what happens ? b = 3; a = b++; ?
(A) A contains 3 and b contains 4
(B) A contains 4 and b contains 4
(C) A contains 4 and b contains 3
(D) A contains 3 and b contains 3
78. How many times is a do while loop guaranteed to loop ?
(A) 0
(B) Infinitely
(C) 1
(D) Variable
79. Which of the following is not a valid relational operator ?
(A) = =
(B) =>
(C) >=
(D) >=
80. Strings are character arrays. The last index of it contains the null-terminated
character :
(A) \n
(B) \t
(C) \0
(D) \1
81. What will be the values of x, m and n after the execution of the following
statements ?
Int x, m, n; m = 10; n = 15; x = ++m + n++;
(A) x=25, m=10, n=15
(B) x=26, m=11, n=16
(C) x=27, m=11, n=16
(D) x=27, m=10, n=15
82. Consider the following statements : int x = 22, y=15; x = (x>y) ? (x+y) : (x-y);
What will be the value of x after executing these statements ?
(A) 22
(B) 37
(C) 7
(D) Error. Cannot be executed
83. Which of the following keywords is used to control access to a class member ?
(A) Default
(B) Break
(C) Protected
(D) Asm
84. Which of the following means “The use of an object of one class in definition of
another class” ?
(A) Encapsulation
(B) Inheritance
(C) Composition
(D) Abstraction
85. A derived class is also called a ____________.
(A) Small class
(B) Subclass
(C) Noticeable class
(D) Big class
86. Which of these inheritances is shown in case we inherit some base class from
another class, then one of the classes derives it ?
(A) Single
(B) Multiple
(C) Multi-level
(D) Hierarchical
87. _________ is the universal handler class for exceptions.
(A) Maths
(B) Object
(C) Exceptions
(D) Errors
88. Conversion of data type is called :
(A) Self referencing
(B) Type casting
(C) Virtual function
(D) Abstract class
89. The function contain in the ios class to set width :
(A) width()
(B) precision()
(C) fill()
(D) setf()
90. The function contain in the class iomanip to set width :
(A) setw()
(B) set precision()
(C) set fill()
(D) setiosflags()
91. How many default constructors per class are possible ?
(A) Only one
(B) Two
(C) Three
(D) Unlimited
92. How many times a constructor is called in the life-time of an object ?
(A) Only once
(B) Twice
(C) Thrice
(D) Depends on the way of creation of object
93. The mechanism of deriving one base class with more than one derived classes :
(A) Multilevel inheritance
(B) Multiple inheritance
(C) Hybrid inheritance
(D) Hierarchical inheritance
94. Which of the following is not correct :
(A) Only existing operator can be overloaded
(B) The overloaded operator must have at least one operand
(C) We can change the basic meaning of the operator
(D) Overloaded operators follow the syntax rule of original operator
95. A member function for unary operator overloading takes ___________ arguments.
(A) Zero (B) One
Two
None
96. Which of the following function / type of function cannot be overloaded ?
(A) Member function
(B) Static function
(C) Virtual function
(D) Both (B) and (C)
97. Copy constructor must receive its arguments by _____________.
(A) Either pass-by-value or pass-by-reference
(B) Only pass-by-value
(C) Only pass-by-reference
(D) Only pass by address
98. The break statement causes an exit :
(A) From the innermost loop only
(B) Only from the innermost switch
(C) From all loops & switches
(D) From the innermost loop or switch
99. The arrays of variable that are of the type class :
(A) Array of object (B) Pointer (C) Object (D) Structure
100. Which of the following type of data member can be shared by all instances of its
class ?
(A) Public (B)Inherited (C)Static (D) Friend
ANSWER
Q A Q A Q A Q A Q A
1 A 21 A 41 B 61 D 81 C
2 C 22 C 42 C 62 A 82 B
3 B 23 D 43 C 63 A 83 C
4 B 24 A 44 D 64 B 84 C
5 A 25 C 45 A 65 C 85 B
6 B 26 D 46 D 66 D 86 C
7 A 27 C 47 A 67 D 87 B
8 A 28 B 48 B 68 D 88 B
9 A 29 B 49 C 69 A 89 A
10 C 30 C 50 B 70 D 90 A
11 A 31 A 51 C 71 B 91 A
12 B 32 B 52 B 72 A 92 D
13 C 33 C 53 C 73 C 93 D
14 B 34 C 54 C 74 C 94 C
15 B 35 B 55 A 75 A 95 B
16 C 36 B 56 A 76 C 96 D
17 D 37 C 57 A 77 A 97 C
18 D 38 D 58 D 78 C 98 D
19 D 39 B 59 C 79 B 99 A
20 B 40 A 60 D 80 C 100 C
.