Quiznetik

Object Oriented Programming with C++ (OOP in C++) | Set 1

1. In object oriented Programming the program is divided into ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐.

Correct : B. object

2. Which one is the Object Oriented Programming language?

Correct : C. C++

3. The wrapping up of data and functions into a single unit is called ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐.

Correct : B. encapsulation

4. The process by which objects of one class acquire the properties of objects of another class is called ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ .

Correct : B. inheritance

5. In OOP which cocept provides the idea of reusability.

Correct : A. inheritance

6. The process of making an operator to exhibit different behaviors in different instances is called ‐‐‐ ‐‐.

Correct : B. operator overloading

7. The process of making a function to exhibit different behaviors in different instances is called ‐‐‐‐‐.

Correct : A. function overloading

8. Objects communicate with one another by using ‐‐‐‐‐‐‐‐‐‐.

Correct : A. message passing

9. Through ‐‐‐‐‐‐‐‐ we can eliminate redundant code and extend the use of existing class.

Correct : A. inheritance

10. The ‐‐‐‐‐‐‐‐‐ principle helps the programmer to build secure programs.

Correct : C. data hiding

11. What are the basic run time entities in an object oriented program?

Correct : A. objects

12. OOPs follows ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ approach during program design.

Correct : B. bottom ‐up

13. The technique of Hiding internal details in an object is called‐‐‐‐‐

Correct : C. Abstraction

14. classes are ‐‐‐‐‐‐‐‐ datatype.

Correct : B. user‐defined

15. ‐‐‐‐‐‐‐‐‐‐ provides interface between the object’s data and program.

Correct : B. functions

16. ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ refers to the linking of procedure call to the code to be executed in response to the call.

Correct : C. dynamic binding

17. A ‐‐‐‐‐‐‐‐ for an object is a request for execution of a procedure.

Correct : D. message

18. The << operator is known as‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐.

Correct : D. both a & c

19. The >> operator is known as‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐.

Correct : D. both b & c

20. ‐‐‐‐‐‐‐‐ contains function prototype for the standard input and output functions.

Correct : B. iostream.h

21. In C++ default return type for all the functions is ‐‐‐‐‐‐‐‐‐.

Correct : A. int

22. Tne multiple use of input and output operator is called …………….

Correct : C. cascading

23. Which of the following is not a feature of OOPs.

Correct : D. none of these.

24. ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ model is also known as linear sequential model.

Correct : B. waterfall model

25. In UML ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ is a collection of things tied together through relationships.

Correct : C. diagrams

26. A ‐‐‐‐‐‐‐‐ is a physical device that exists at run time.

Correct : A. node

27. Which of the following is a UML relationship.

Correct : D. all of the above

28. Which of the following is a UML constituents

Correct : D. all of the above

29. ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ are conceptual things which exists only during the development process.

Correct : A. Package

30. ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ relationship indicates that the change to an independent thing will affect the dependent thing.

Correct : B. dependency

31. ‐‐‐‐‐‐‐ can represent items of varying data types to an item.

Correct : C. Structures

32. ‐‐‐‐‐‐ are the smallest or the atomic elements of a language.

Correct : D. Tokens

33. Blanks, tabs, newlines, form feeds and comments are collectively called ‐‐‐‐‐‐‐

Correct : B. White space

34. Find the false statement from the following

Correct : C. Identifiers are not case sensitive.

35. The instructions, which are used in programming, are called ‐‐‐‐‐‐‐‐

Correct : B. Keywords

36. ‐‐‐‐‐ are the reserved words of the programming language.

Correct : D. Keywords

37. ‐‐‐‐‐ refer to the names of variables, functions, arrays, classes, etc.

Correct : A. Identifiers

38. Write the range of value of the data type ‘char’

Correct : D. ‐128 to 127

39. Write the range of value of the data type ‘int’

Correct : A. ‐32,768 to 32,767

40. The standard ASCII characters have numeric values from ‐‐‐ to ‐‐‐‐

Correct : B. 0 to 127

41. Identify the data type of the value ‐2567113254L

Correct : A. Long integer

42. Identify the valid integer from the following:

Correct : D. +324454ul

43. A ‐‐‐‐‐ is the name of the storage location

Correct : B. Variable

44. The operator “>>” is called ‐‐‐‐‐

Correct : A. Extraction operator

45. Array indexing always starts with the number

Correct : A. 0

46. We declare a function with ______ if it does not have any return type

Correct : C. void

47. Which of the following is selection statement in C++?

Correct : D. switch

48. There is a unique function in C++ program by where all C++ programs start their execution

Correct : C. main()

49. A block comment can be written by

Correct : B. Starting with /* and ending with */

50. Which of the following is a correct comment?

Correct : C. /* Comment */

51. Which of the following is not a correct variable type?

Correct : B. Real

52. A variable is/are

Correct : B. A portion of memory to store a determined value

53. By default, the members of a C++ class are:

Correct : A. Private

54. Which of the following function that must contain in all C++ Programs

Correct : C. main()

55. Which one of the following is the correct operator to compare two values

Correct : D. = =

56. C++ is originally developed by

Correct : C. Bjarne Stroustrup

57. The operator ‘<< ‘is called

Correct : B. Put to operator

58. Identify the unary operator.

Correct : B. ++

59. The ‐‐‐‐‐‐‐ are used to check the relationship between two numeric operands or expressions.

Correct : B. Relational operators

60. To increase the value of c by one which of the following statement is wrong?

Correct : C. c + 1 => c;

61. In an assignment statement a=b Which of the following statement is true?

Correct : B. The value of b is assigned to variable a but the later changes on variable b will not affect the value of variable a

62. The continue statement

Correct : C. skips the rest of the loop in current iteration

63. Find out the error in following block of code. If (x = 100) Cout << “x is 100”;

Correct : C. Equals to operator mistake

64. What is the final value of x when the code int x; for(x=0; x<10; x++) {} is run?

Correct : A. 10

65. When following piece of code is executed, what happens?b = 3; a = b++;

Correct : A. a contains 3 and b contains 4

66. In case of arguments passed by values when calling a function such as z=addidion(x,y),

Correct : A. Any modifications to the variables x & y from inside the function will not have any effect outside the function.

67. How many times is a do while loop guaranteed to loop?

Correct : C. 1

68. Which of the following is not a valid relational operator?

Correct : B. =>

69. The result of a Relational operation is always

Correct : A. either True or False

70. A ‐‐‐‐‐‐‐‐ is a memory portion of memory to store a determined value.

Correct : B. Variable

71. An identifier may ‐‐‐‐‐‐‐‐

Correct : C. The name of a variable.

72. The visibility of variables inside a structure is

Correct : B. Public

73. ‐‐‐‐‐‐‐ are used for comparing two conditions or to write a compound condition.

Correct : D. Logical operator

74. ‐‐‐‐‐ statement is used to print a blank line in CPP program

Correct : C. Both ‘a’ and ‘b’

75. int d=int (a) + int (b);This statement is an example of ‐‐‐‐‐‐‐

Correct : B. Explicit conversion

76. Within a switch statement

Correct : B. Continue cannot be used but Break can be used

77. Strings are character arrays. The last index of it contains the null‐terminated character

Correct : C. \0

78. Observe following function declaration and choose the best Ans:: int divide ( int a, int b = 2 )

Correct : D. Variable b will have value 2 if not specified when calling function

79. Arguments of a functions are separated with

Correct : A. comma (,)

80. Variables inside parenthesis of functions declarations have _____ level access.

Correct : A. Local

81. ‐‐‐‐‐‐‐‐‐‐‐ Statement used to branch unconditionally from one point to another in the program.

Correct : B. goto

82. A white space is :

Correct : D. all of the above

83. Which of the following statements are true in c++?

Correct : B. Structures cannot have functions as members.

84. 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++;

Correct : B. x=26, m=11, n=16

85. 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?

Correct : B. 37

86. ‐‐‐‐‐‐‐ is the actual body of the function

Correct : C. Function definition

87. Which of the following is an exit controlled loop?

Correct : D. do…. While

88. ‐‐‐‐‐ is a function that is expanded in line when it is invoked.

Correct : C. Inline function

89. The qualifier ‐‐‐‐‐‐ tells the compiler that the function should not modify the argument.

Correct : A. Const

90. ‐‐‐‐‐‐ refers to the use of the same thing for different purpose.

Correct : B. Overloading

91. The functions declared inside the class is known as ‐‐‐‐‐‐‐‐

Correct : C. Member functions

92. The binding of data and functions together into a single class‐type is referred to as ‐‐‐‐‐‐‐‐

Correct : B. Encapsulation

93. When a function is defined inside a class,it is treated as ‐‐‐‐‐‐‐

Correct : A. Inline function

94. Calling a member function by using its name from another member function of the same class is known as ‐‐‐‐‐‐

Correct : C. Nesting of member function

95. ‐‐‐‐‐ function can only be called by another function that is a member of its class.

Correct : B. Private member function

96. ‐‐‐‐‐‐‐‐ are normally used to maintain values common to the entire class.

Correct : B. Static variables

97. A static variable is initialized to ‐‐‐‐‐when the first object of its class is created.

Correct : C. 0

98. The same function name having different tasks

Correct : A. Function overloading

99. The main function having argument

Correct : B. Command line argument

100. A function calling itself

Correct : D. Recursion