Object Oriented Programming (OOPs) MCQs > FREE SET - 5

1. Code that has already been tested is said to be _________
A inherited
B reusable
C reliable
D polymorphic

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

2. The get() function returns ________
A a character
B void
C a reference to the object that invoked it
D a copy of the object that invoked it

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

3. The number 5.5e3 is a _________ constant
A character literal
B named literal
C numeric literal
D string literal

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

4. You can place function templates
A at the end of main()
B at the start of a program above main()
C in two files-one for the definition and one for the function
D any of the above

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

5. The two operators && an || are
A arithmetic operators
B equality operators
C logical operators
D relational operators

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

6. The arguments that determine the state of the cout object are called _________
A classes
B manipulators
C format flags
D state controllers

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

7. Static variables are sometimes called
A class variables
B functional variables
C dynamic variables
D auto variables

Free MCQs www.sharemcq.com     Answer: Option A
Explanation:
Available Soon.

8. The variables declared in a statement block or listed in a function header's parameter list are considered _________ variables
A area
B global
C local
D reference

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

9. An expression
A is a collection of data objects and operators that can be evaluated to a single value
B is a name that substitutes for a sequence of characters
C causes the computer to carry out some action
D All of the above

Free MCQs www.sharemcq.com     Answer: Option A
Explanation:
Available Soon.

10. In the C language, the character type of constant is delimited by using
A single quotes
B double quotes
C parenthesis
D #

Free MCQs www.sharemcq.com     Answer: Option A
Explanation:
Available Soon.

11. One way in which a structure differs from an array is that _________
A a structure may have members of more than one type
B a structure must have members that; are all the same type
C art array may have members of more than one type
D there is no difference between a structure and an array

Free MCQs www.sharemcq.com     Answer: Option A
Explanation:
Available Soon.

12. Storing a class definition in a separate file is an example of
A polymorphism
B name mangling
C implementation hiding
D inheritance

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

13. Which of the following C++ expressions will find the square root of the number 16?
A root (16, 2)
B sqroot (16)
C sqrt (16, 2)
D sqrt (16)

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

14. Catch blocks must _________
A appear in every object-oriented program
B appear within try blocks
C appear immediately after throw statements
D appear immediately after try blocks

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

15. An exception specification begins with the keyword _________
A exception
B try
C throw
D catch

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

16. You construct a class in two sections, known as the __________
A header and body
B type and parameters
C declaration and implementation
D pointer and variable

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

17. The statement i*=3 is equivalent to
A i = 3*
B i = 3
C i* = 3
D i = i * 3

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

18. The complement operator is represented by the symbol
A ~
B ^
C i
D <

Free MCQs www.sharemcq.com     Answer: Option A
Explanation:
Available Soon.

19. The rules to any programming language are its ___________
A syntax
B interpretation
C logic
D customs

Free MCQs www.sharemcq.com     Answer: Option A
Explanation:
Available Soon.

20. The last statement in a value-returning function is always _________
A };
B result expression;
C return;
D return expression;

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

21. Which of the following declares and initializes an Integer variable named numltems?
A int numltems = 0;
B int numltems = '0';
C integer numltems = 0;
D numltems int = 0;

Free MCQs www.sharemcq.com     Answer: Option A
Explanation:
Available Soon.

22. The #include instruction is called a
A direction
B directive
C merge instruction
D statement.

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

23. Classes holds _________
A data
B methods
C both data and methods
D neither data nor methods

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

24. When you declare a pointer, you must give it a ________
A type
B type and name
C type, name, and value
D name and value

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

25. Any #include files may contain
A constants
B variables
C functions
D All of the above

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

26. When a break statement is used in a loop, the control skips the rest of the statements in the loop after it and jumps
A to the last lines in the program
B to the next statement written after the body of the loop
C to the first statement in the body of the loop
D All. of the above

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

27. Making class members inaccessible to non-member functions is an example of
A polymorphism
B data hiding
C redundancy
D recursion

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

28. _________ variables remain in memory until the statement block ends
A Area
B Global
C Local
D Reference

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

29. The actual arguments cannot he
A a constant or a variable
B of a different type from the corresponding formal arguments
C other functions
D expressions

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

30. Software that can be used in applications other than the one for which it was originally written is called
A recyclable
B inherited
C reusable
D cheating

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

31. Typing the function's name as Main, rather than main, is an example of
A an entry error
B a function error
C a logic error
D a syntax error

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

32. A function argument is
A a variable in the function that receives a value from the calling program
B a way that functions resist accepting the calling program's values
C a value sent to the function by the calling program
D a value returned by the function to the calling program

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

33. A function that is prototyped as double calculate(int num); may__________
A receive an integer constant such as 5
B receive an integer variable
C either (A) or (B)
D neither (A) nor (B)

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

34. Passing a variable pointer as a constant ___________
A protects the contents pointed to by the pointer from change
B eliminates the need to name the pointer in the function
C eliminates the need to give the pointer a type in the function
D causes a copy of the pointer to be produced in the function

Free MCQs www.sharemcq.com     Answer: Option A
Explanation:
Available Soon.

35. Recursive Functions
A easier to code
B executable faster than iterative ones
C takes less main storage space
D necessary to solve a certain class of problems

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

36. The purpose of a conditional operator is to
A select one of the two values
B select the highest of the two values
C select one of the two values depending on a condition
D select the more equal of the two values

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

37. Which of the following, if any, are valid names for variables?
A amt.Sold
B amt-Sold
C amt_Sold
D 98Sold

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

38. Assume you want to compare the character stored in the initial variable to the letter a. Which of the following conditions should you use in the if statement? (Be sure the condition will handle a or A.)
A (initial = 'a' or 'A')
B (initial == 'a' or 'A')
C (toupper(initial) = 'A')
D (toupper(initial) == 'A')

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

39. You can override a class's inherited access to make an individual member's access more __________
A liberal
B conservative
C either (A) or (B)
D neither (A) nor (B)

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

40. A class hierarchy
A describes "is a kind of" relationships
B describes "has a" relationships
C shows the same relationships as an organization chart
D shows the same relationships as a family tree

Free MCQs www.sharemcq.com     Answer: Option A
Explanation:
Available Soon.

41. The right shift operator is represented by the symbol
A >
B >>
C ->
D <

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

42. In C++, class definitions are most often
A stored with each program that uses them
B stored in a header file that is included in the programs that use them
C stored in a folder that you paste into every new project
D retyped for every new project

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

43. The comma operator (,) is primarily used in conjunction with
A 'for' statement
B 'if-else' statement
C 'do-while' statement
D All of the above

Free MCQs www.sharemcq.com     Answer: Option A
Explanation:
Available Soon.

44. To execute a C++ program, you first need to translate the source code into object code. This process is called
A coding
B compiling
C sourcing
D translating

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

45. An array element is accessed using
A a first-in-first-out approach
B the dot operator
C a member name
D an index number

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

46. The program can access the private members of a class
A directly
B only through other private members of the class
C only through other public members of the class
D None of the above - the program cannot access the private members of a class in any way

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

47. To hide a data member from the program, you must declare the data member in the _________ section of the class
A concealed
B confidential
C hidden
D private

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

48. External documentation includes
A a printout of the program's code
B flowcharts
C IPO charts
D pseudocode

Free MCQs www.sharemcq.com     Answer: Option A
Explanation:
Available Soon.

49. A function that is called automatically each time an object is created is a(n)
A constructor
B contractor
C builder
D architect

Free MCQs www.sharemcq.com     Answer: Option A
Explanation:
Available Soon.

50. A variable's _________ indicates how long the variable remains in the computer's memory
A area
B extent
C lifetime
D reach

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.


No comments:

Post a Comment

Your Feedback is hearty Requested to make the MCQs Collection better.

Popular Posts