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

1. Many programmers separate a class in C++ into two files: _________
A one for the declarations and one for the implementations
B one for the void functions and one for the other functions
C one for the public data and one for the private data
D one for the primary functions and one for the auxiliary functions

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

2. Files whose names end in .h are called __________ files
A handy
B header
C helper
D helping

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

3. When accessing a structure member, the identifier to the left of the dot operator is the name of
A a structure member
B a structure tag
C a structure variable
D the keyword struct

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

4. Inheritance occurs when a class adopts all the traits of _________
A an object
B a parent class
C a variable
D a function

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

5. Template classes that have already been written to perform common class tasks are called __________
A container classes
B receptacle classes
C repository classes
D alembic classes

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

6. You declare a function with a function _____________, which is typically entered at the beginning of the program, below the #include directives
A call
B prototype declaration
C definition
D pointer

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

7. The most common operation used in constructors is
A Addition
B Overloading
C Assignment
D Polymorphism

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

8. If two types of errors may be thrown, you should write __________
A no catch blocks
B one catch block with two arguments
C two catch block-one with an argument, and one without
D two catch blocks with one argument each

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

9. Which of the following is not a programming control structure?
A Repetition
B Selection
C Sequence
D Sorting

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

10. The bitwise OR operator is a
A unary operator
B binary operator
C ternary operator
D octal operator

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

11. The continue statement should be written only
A in the body of a loop
B in the nested loops
C outside the body of a loop
D any where

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

12. A major advantage of inheritance is
A Reducing the time it takes to create new objects
B Not having to think about how objects will be used
C Reducing the amount of memory required to execute a program
D Enabling people who have not studied programming to create useful applications

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

13. When a variable exists or is accessible, it is said to be __________
A immediate
B in the path
C available
D in scope

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

14. The feature that allows the same operations to be carried out differently depending on the object is __________
A polymorphism
B polygamy
C inheritance
D multitasking

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

15. Which of the following is a C++ class?
A >>
B read()
C cin
D iostream

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

16. Precedence determines which operator
A is evaluated first
B is most important
C is fastest
D operates on the largest number

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

17. When using the standard files that come with the C++ compiler, you should surround the header file name with __________
A square brackets
B angle brackets
C parentheses
D quotes

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

18. The loop condition in a flowchart is represented by a(n) __________
A Diamond
B Oval
C Parallelogram
D Rectangle

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

19. Inheritance is the principle that
A Classes with the same name must be derived from one another
B Knowledge of a general category can be applied to more specific objects
C C++ functions may be used only if they have logical predecessors
D One function name may invoke different methods

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

20. If no exception is thrown ____________
A A catch block will cause an error
B The first catch block coded will execute
C The last catch block coded with execute
D Any catch blocks coded with be bypassed

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

21. A program that predicts the exact sequence in which events will take place is said to be _____________
A Compiled
B Interpreted
C Procedural
D Object-oriented

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

22. A blueprint for creating an object in C++ is called _________
A a class
B an instance
C a sketch
D a pattern

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

23. The prototype for a derived class constructor may include arguments for
A Data members of the derived class
B Data members of the base class
C Both (A) and (B)
D Neither (A) nor (B)

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

24. Overloading involves writing two or more functions with ___________
A Different names and different argument lists
B Different names and the same argument list
C The same name and different argument lists
D The same name and the same argument list

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

25. One way pointers are useful to refer to a memory address that has no _________
A name
B constant
C location
D field

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

26. Two access specifiers in C++ are
A public and private
B int and double
C formal and informal
D void and free

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

27. Within parentheses, catch blocks can have __________
A No arguments
B One argument
C Two arguments
D As many arguments as necessary

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

28. The while loop is referred to as a(n) _________ loop because the loop condition is tested at the beginning of the loop.
A Beginning
B Initial
C Pretest
D Priming

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

29. The word
A Function in the C++ language
B Data type in the C++ language
C Keyword in the C++ language
D Global variable in the C++ language

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

30. The statement int num[2][3]={ {3,8,6}, {9,4,7}};
A assigns a value 4 to num[1][2]
B assigns a value 7 to num[1][2]
C assigns a value 8 to num[1][2]
D assigns a value 9 to num[1][2]

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

31. Private data can be accessed by
A Class member functions
B Functions in derived classes
C Both (A) and (B)
D Neither (A) nor (B)

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

32. The store of memory available to programs is the __________
A store
B stack
C pile
D heap

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

33. When a function performs tasks based on a decision, it has __________
A Functional cohesion
B Coincidental cohesion
C Logical cohesion
D No cohesion

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

34. To create a template class in C++, you begin with ____________
A The template definition
B The keyword class
C The function definitions
D The keyword definition

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

35. Which of the following is a C++ object?
A >>
B read()
C cin
D iostream

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

36. A function in C++ can
A return a value
B perform a task
C change value of actual arguments in call by reference
D All of the above

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

37. The statement float values[]={3.14, -7.86, 36.96, 4.87};
A assigns 36.96 to values[2]
B assigns -7.86 to values[2]
C gives an error message
D assign 14 to values[2]

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

38. A constructor initialization list in C++ is preceded by ________
A a semicolon
B a colon
C two colons
D a space

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

39. When the compiler places a copy of a small function's statements directly into a program, the function is said to be
A Overloaded
B Mangled
C Inline
D Redundant

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

40. To send output to a file, you need to include the __________ header file in your C++ program
A file.h
B fstream.h
C iomanip.h
D iostream.h

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

41. A difference, between reference variables and pointers is that
A Reference variables are easier to use
B Pointers are easier to use
C Reference variables are more flexible
D No difference exists between reference variables and pointers

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

42. A 'C
A a function header
B argument declarations
C other 'C' functions
D function body

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

43. __________ variables remain in memory until the program ends.
A Area
B Global
C Local
D Reference

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

44. The outline or the definition of a function is called its
A beta test
B forerunner
C outline
D prototype

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

45. A variable's ___________ indicates which portions of the program can use the variable.
A area
B extent
C lifetime
D scope

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

46. _________ variables are declared outside of any statement block.
A Area
B Global
C Local
D Reference

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

47. The end of string is recognized by
A the null character
B the newline character
C the $ sign
D the / sign

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

48. Variable names known only to the procedure in which they are declared are __________
A local
B global
C recent
D internal

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

49. The C++ expression p --> val means the same thing as
A *p.val
B *(p.val)
C (*p).val
D p.val

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

50. Which of the following tells C++ to display numbers with zero decimal places?
A setiosflags(0)
B setiosflags(zero)
C setprecision(0)
D setprecision(zero)

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