Vous êtes sur la page 1sur 5

OBJECT ORIENTED PROGRAMMING WITH C++

a)

Class b) Object c) Data d) Function.

14. In Inheritance, the new class is called as ____________ class. 1. Decomposition of a problem into a number of entities are called _____________. a) Data b) objects c) Algorithm d) Flowchart. a) Base b) Derived c) Parent d) Abstract. 15. The function used to fill the unused position is ________________

2. The return type of main( ) function is ___________ by default a) Unfill( ) b) Fill( ) c) Width( ) d) Showpos( ). in c++. 16. The C++ statements terminates with ____________ a) Float b) Constant c) Int d) Double. a) Comma b) Dot c) Colon d)Semicolon. 3. The objects can be destroyed by_________ when they are not required 17. The keyword, which is used as visibility label, is ________________a) Destructor b) Constructor c) Class d) Function. a) Private b) Struct c) Union d) Class. 4. The mechanism of deriving a new class from an old class is called _______________ 18. The Constructor with no parameters is called _____________ constructor. a) Binding b) Polymorphism c) Data Hiding d) Inheritance. a) Copy b) Inline c) Default d) Parameterized. 5. The manipulator resetiosflags( ) is equivalent to__________ 19. The traits of one class may be inherited by more than one class. ios function. This process is known as _________ a) setf( ) b) unsetf( ) c) setw( ) d) setfill( ). a) Single b) Hierarchical c) Multiple d) Hybrid.

6. The programming language that follows top-down approach is 20. Showpos( ) flag is used to print the + sign before ____________ ___________ numbers. a) C++ b) Java c) None d) C. 7. Data hiding is not possible in ____________ a) C b) C++ c) VB d) Java. a) Return 8. Objects can be initialized using_____________ a) Keyword b) Destructor c) Constructor d) Structure. 22. If visibility labels are missing, then by default, all the members are _________ a) Protected b) Public c) Private d) None. b) Goto c) Break d) Continue. a) Integer b) Float c) Negative d) Positive. 21. C++ programs begins at main( ) function and ends with __________ statement.

9. In Inheritance, the old class is called as _________ class. a) Derived b) Base c) Child d) Sub.

23. If more than one constructor function is defined in a class it is called _______ overloading. 10. The number of digits to be displayed after the decimal point is denoted by ___________ a) Function b) Constructor c) Operator d) String a) Precision( ) b) Width( ) c) Fill( ) d) Showpos( ). 11. The wrapping up of data and functions into a single unit is called __________________ a) Inheritance b) Polymorphism Encapsulation. c) Abstraction d) 25. The header file ________ provides a set of functions called manipulators. a) iomanip b) iostream c)istream d) streambuf. 26. The smallest individual units in a program are known as _________ a) Blocks b) Tokens c) Data Type d) Statements. 24. A member declared as ___________ is accessible by the member functions within its class and any class immediately derived from it. a) Private b) Public c) Virtual d) Protected.

12. The structure declaration is similar to ___________ declaration. a) Array b) Function c) Class d) Variable. 13. Constructor name should be same as the ___________ name.

27. The variables declared inside the class are called ____________ members. a) Class b) Public c) Data d) Private

a) seekg( ) b) get( ) c) tellp( ) d) put( ) 41. The user-defined data type in c++ is _______________ a) Array b) Pointers c) Class d) Functions.

28. The member function concatenates two strings is called _____________. a) add( ) b)concat( ) c) none d)join( )

42. The dereferencing operator is _____________ a) * b) :: * c) d) .*

29.The process of dividing a class from the derived class is called 43. Friend function can be used to overload ________________ ___________ inheritance. operator. a) Multilevel b) Multiple c) Single d) Hybrid. a) Binary b) Assignment c) Function Call d) Subscripting.

30. To inert a new line ____________ manipulator is used. a) setfill b) endl c) new d) setline.

44. Stings in one dimensional array starts with the index 0 and ends with _____________ a) Semicolon(;) b) Null Character (\0) c) Colon (:) d) none. 45. To create a family of classes or functions __________ can be used. a) Array b) Macro c) Templates. D) Functions. 46. The operator new is used for _____________ a) Linefeed b) Memory Allocation c) Field Width d) Memory Release

31. The fixed values that does not change during the execution of the program is called _______ a)Variables b)String c)Constant d) Identifiers

32.Static variable is initialized to ________________ when the first object is created. 47. The objects are the variables of __________ a) Function b) Class c) Data d) Operators. a) One b)Three c) Two d) Zero. 48. An object that currently invokes a member function is 33. A destructor is preceded by _______________ referred by __________ pointer. a)Tilde b)Semicolon c) Colon d) Comma. 34. To avoid duplicates ____________ class is used. a) this b) member c) function d)base. a) Derived b) Virtual Base c) Parent d)Base 49. The casting operator function must _____________ Specify the b) not be a c) have no arguments d) have arguments. Return type class member 50. A function generated from a function template is called a ___________ function. a) Friend b) Virtual c) Parameterized d) template. a)

35. The class which provides the input operation get( )is called ____________. a) fstream b) ofstream c) ifstream d) file buf.

36. A function can be declared as a friend to ______________ class. a)

Only One b) Two c) Limited Number of d) Any number 51. C++ allows us to give several meanings to an operator, based of on the types of arguments used is called _____________ overloading. 37.The operators which can be overloaded is ______________ a) Function b)Operator c) Variable d) Both b & c. a) Unary Minus b) Size of c) ?: d) :: 52. The class declaration ends with _________. 38. Wide - Character Literals begins with the letter ______________ a) ; b) : c) :: d) //. a) W b) C c) L d) WL. 53. The conditional operator is ___________. a) :: b) ?: c) d) None.

39.The address of operator or the reference operator is _____________ a) :: b) & c) d) *

54. In C++, we cannot have virtual _____________. a) Class b) Functions c) Constructors d) Destructors. 40. The function _____________ writes a single character to the associated stream. 55. Exceptions are of _________ kinds.

a)

Two b) Three c) Five d) Seven.

a) Binding b) Data Hiding c) Polymorphism d) Inheritance. 69. One name having multiple forms is called as ________. a) Encapsulation b) Dynamic binding c) Abstraction d) Polymorphism .

56. Constant expression consists of __________ values. a) Float b) Constant c) Boolean d) Integer.

57. More than one function with the same name in a program is 70. Generic types are used as parameters in ______________ called _______. programming. Function overloading b) Operator overloading c) a) Generic b) Object c) Procedure oriented d) Modular. Inheritance d) Polymorphism. 58. The constructor that accepts a reference to its own class as a 71. An exit-controlled loop statement is ____________. parameter is called _______ constructor. a) While b) Do-while c) For d) Switch . a) Default b) Copy c) Parameterized d) Inline. 72. Name of the identifier should not contain any ___________. a) Alphabets b) Digits c) Special characters d) Underscore. 73. The range of integer data type is ___________. 60. The catch block immediately follows the ________ block. a) a) Throw b) Try c) Hit d) Main. 61. The bit wise expression x >> 3 is used to shift ________. a) 3 bits to the right b) 3 bits to the left Shift right. c) Shift left d) 32768 to 32767 b) 128 to 127 c) 32767 to 32768 d) 127 to 128. a)

59. The virtual function may not be a _______ member. a) Class b) Public c) Protected d) Static.

74. A class containing pure function is called __________class. a) Abstract b) Derived c) Parent d) Virtual.

62. The keyword, which is used as visibility label, is ____________. a) Private b) Struct c) Union d) Class.

75. The number of arguments in the command line is represented by _________. a) int b) argc c) argv d) char.

76. One pointer can be __________ another pointer. 63. Constructors can be called __________. a) a) Explicitly b) Implicitly c) Both a & b d) None. 64. A virtual function equated to _______ is called pure virtual function. a) Zero b) One c) Two d) Three. added to b) multiplied by c) divided by d) subtracted from.

77. The keyword, which automatically enumerates a list of words by assigning them values, is called ________. a) enum b)extern c) volatile d) register.

65. When an exception is thrown, it will be caught by the _________ statement. a) Throw b) Try c) Return d) Catch. 66. The multiple-branching statement where, based on the condition, the control is transferred to one of the many possible points is _____________. a)Switch statement b) If-else c) While d) For. 67. A member function can be called by using its name inside another member function of the same class is called ________. a) Friend b) Virtual c) Nesting of d) Static.

78. The pointers, which are not initialized in a program are called ________ pointers. a) File b) Null c) Generic d) Void. 79. The function, which returns true when an output or input operation has failed, is called_________ a) eof( ) b) bad( ) c) fail( ) d) good( ). 80. Integer takes ________ bytes to store its value in binary form. a) Three b) Two c)Four d) Eight. 81. While declaring the pointer, the data type is followed by ________ symbol. a) * b) c) : d) ;

68. Insulation of data from direct access by the program is called ___________.

82. Streambuf acts as a base for filebuf class used in _________files. a) iomanip b) ios c) istream d) fstream.

a) Relational b) Boolean c) Arithmetic d) dot. 97. The scope resolution operator is __________. a) :: b) ::* c) .* d) *.

83. The type conversion must have _______ class. 98. ADT stands for ____________. a) Source b) Destination c) Both a & b d) User defined. 84. The expression that yields the result of Boolean type is called _______ expression. a) Float b) Constant c) Integral d) Relational. a) showpos b) showpoint c) left d) stdio. 85. C++ achieves polymorphism through ________ function. a) Friend b) Inline c) Static d) Virtual. 86. A data type that holds the address of a location in memory is called ________. a) Void b) Pointer c) Char d) Double. 1) b 87. The situation in which a derived class has only one base is called _________ inheritance. 2) c a) Single b) Multiple c) Hybrid d) Hierarchical. 3) a 43) a 83) c 4) d 89. The operator += is known as _________ operator. a) Compound assignment b) Chained assignment c) Embedded assignment d) None. 5) b 45) c 85) d 6) d 46) b 86) b 7) a 47) b 87) a 8) c 48) a 88) c 9) b 49) c 89) a 10) a a) endl b) sizeof c) new d) delete. 11) d 51) b 91) a 12) c 52) a 92) a 13) a 53) b 93) a 14) b 96. Member variables can be accessed using __________ operator. 54) c 94) b 34) b 74) a 33) a 73) a 32) d 72) c 50) d 90) b 31) c 71) b 94. C++ permits initialization of variables at runtime called _______ initialization. a) Static b) Dynamic c) Runtime d) None. 30) b 70) a 29) a 69) d 28) d 68) b 27) c 67) c 26) b 66) a 44) b 84) d 25) a 65) d 24) d 64) a 42) a 82) b 23) b 63) c 88. A file containing the source code is called _________ file. a) Destination b) Header c) Source d) None. 41) c 81) a 22) c 62) a 21) a 61) a 100. The stream that supplies data to the program is called as ___________ stream. a) iostream b)input c) output d) file. ANSWERS a) Abstract Data Transfer b) Application Design Table c) Abstract Data Type d) Accurate Data Transmision. 99. Flags that have bit field is _____________.

90. The extraction operator is ________. a) << b) >> c) > d) <. 91.The insertion operator is also called as ________ operator. a) Put to b) Extraction c) Get from d) Input. 92. The function, which gives the current position of get pointer, is called _______. a) tellg( ) b) tellp( ) c) seekg( ) d) seekp( ). 93. The most commonly used manipulator in C++ is _________.

95. Private data members and private functions can be accessed by __________ functions. a) Friend b) Virtual c) Member d)Static.

a.inline b.friend c.virtual d.none of the above 14) .The relationship between base and derived class is known as ______________ . 16) d 36) d a.kind of relationship b.reusability c.access specifiers d.none 56) b 76) d 15)The combination of one or more type of inheritance is known 96) d as ___________ 17) a 37) a inheritance. 57) a 77) a a.single b.multilevel c.multiple d.hybrid 97) a 16) The pointer is denoted by __________ operator. 18) c 38) c a.& b.* c.= = d.all the above 58) b 78) b 17) The allocation of memory during program run time is called 98) c ____________ 19) b 39) b memory allocation. 59) d 79) c a.static b.dynamic c.pointer d.none of the above 99) c 18) The keyword __________ is a local variable that is always 20) d 40) d present in the body of 60) b 80) b any non-static member function. 100) b a.this b.get c.put d.none of the above 19) The new operator is used to __________________ memory. a.allocates b.deallocates c.destroys d.none of the above 20) The extraction operators are defined in the __________ Extra Questions class. a.istream b.ostream c.iostream d.none 21) The operator __________ converts value of integer variable 1)C++ was developed by _________________ . k into stream of a. Dennis Ritchie b.Bjarne Stroustrup c.Ken Thompson d.none ASCII characters. of the above a.<< b.>> c.= = d.& 2) ._______________ are primary run-time entities in an object 22) A string is nothing but a sequence of characters. oriented programming. a.string b.array c.structures d.class a.class b.object c.inheritance d.polymorphism 23) The function of __________ statement is to send the 3) ._____________ directs to the procedure of representing exception found. essential features without a.try b.throw c.catch d.none including background details. 24) The new operator is used to __________________ memory. a.class b.abstraction c.inheritance d.polymorphism a.allocates b.deallocates c.destroys d.none of the above 4) .______________ object oriented languages widely accepted 25) The ___________ function determines whether the string is by the programmer. empty or filled. a.C++ b.C c.pascal d.cobol a. FULL()b. DECREASE()c. EMPTY()d. NULL() 5) Manipulators use ________________ header file. a.iostream.h b.iomanip.h c.conio.h d.fstream.h 1) b 2)b 3)b 4)a 5)b 6)a 7)b 6) When a variable is declared as static it is initialized to 8)a 9)a 10)a _____________ . 11)a 12)a 13)b 14)a 15)d 16)b 17)b a.zero b.one c.two d.none 18)a 19)a 20)a 7) Bit fields provides exact amount of _____________ required 21)a 22)a 23)b 24)a 25)c for storage of values. a.bytes b.bits c.information d.none 8) A non-member function that can access the private data of the class is known as _______________ function. a.friend b.static c.member d.library 9) The destructor is executed when a.object goes out of scope b.when object is not used c.when object contains nothing d.none 10) The object is declared outside all function bodies is known as ___________ . a. global b.local c.variable d.scope access 11) The unary operator _________ can be used as prefix or suffix with the function. a.++ b.** c.+ d.12) ._____________ operator can be overloaded. a.unary b.prefix c.ternary d.postfix 13) It is possible to overload both these extraction and insertion operator with _______________ . 55) a 95) c 75) b

15) b

35) c

Vous aimerez peut-être aussi