AMCAT COMPUTER PROGRAMMMING PREVIOUS QUESTIONS (PAPERS)-3

Question 1
In c++ how are protected members of a base class accessed in derived class when inherited privately
A. Privately
B. Publicly
C. Protectedly
D. Not Inherited

Correct Op: A

Question 2
Which of the following statements is correct when a class is inherited publicly?
A. Public members of the base class become protected members of derived class.
B. Public members of the base class become private members of derived class.
C. Private members of the base class become protected members of derived class.
D. Public members of the base class become public members of derived class.

Correct Op: D

Question 3
Which of the following access specifies is used in a class definition by default?
A. Protected
B. Public
C. Private
D. Friend

Correct Op: C

Question 4
Which of the following can access private data members or member functions of a class?
A. Any function in the program.
B. All global functions in the program.
C. Any member function of that class.
D. Only public member functions of that class.

Correct Op: C

Question 5
Which of the following statements about virtual base classes is correct?
A. It is used to provide multiple inheritance.
B. It is used to avoid multiple copies of base class in derived class.
C. It is used to allow multiple copies of base class in a derived class.
D. It allows private members of the base class to be inherited in the derived class.

Correct Op: B

Question 6
State whether the following statements about inheritance are True or False. i) A public member of a class can be accessed by its own objects using the dot operator. ii) While inheriting, the private members of the base class will never become the members of its derived class.
A. True, False
B. False, True
C. True, True
D. False, False

Correct Op: C

Question 7
Encapsulation is?
A. Binds together code and data
B. Using single interface for general class of actions.
C. Reduce Complexity
D. All above

Correct Op: A

Question 8
Which of the following concepts means wrapping up of data and functions together?
A. Abstraction
B. Encapsulation
C. Inheritance
D. None

Correct Op: B