C++ Multiple Choice Questions focuses on “Modularization and Interfaces”. One shall practice these questions to improve their C++ programming skills needed for various interviews, entrance exams and other competitive exams. These questions can be attempted by anyone focusing on learning C++ programming language. They can be a beginner, fresher, engineering graduate or an experienced IT professional. Our C++ questions comes with the detailed explanation of the answers which helps in better understanding of C++ concepts.
C++ Questions & Answers focuses on “Modularization and Interfaces” along with answers, explanations and/or solutions:
Q 1. which of the following is used to implement the c++ interfaces?
A. absolute variables
B. abstract classes
C. constant variables
D. default variables
Show Answer
Answer:-B. abstract classesExplanation
Abstract classes in C++ are purposely defined for making base classes containing atleast one virtual function which can be overloaded on inheritance, which means single function name for different sub-classes, hence acts as an interface.Q 2. What is the ability to group some lines of code that can be included?
in the program?
A. specific task
B. program control
C. modularization
D. macros
Show Answer
Answer:-C. modularizationExplanation
Modularization is also similar to macros but it is used to build large projects.Q 3. How many types do functions fall depends on modularization?
A. 1
B. 2
C. 3
D. 4
Show Answer
Answer:-B. 2Explanation
There are two types of functions. They are program control and specific task.Q 4. How many types of modularization are there in c++?
A. 1
B. 2
C. 11
D. 12
Show Answer
Answer:-B. 2Explanation
There are two types of modular programming. They are interface and implementation.Q 5. What does the client module import?
A. macro
B. records
C. interface
D. instance
Show Answer
Answer:-C. interfaceExplanation
Because they access the functions in the module user interface.Q 6. Identify the correct statement.
A. c++ does have built-in interfaces
B. c++ does not have built-in interfaces
C. c++ have no concept of interfaces
D. c++ does have built-in interfaces & classes
Show Answer
Answer:-B. c++ does not have built-in interfacesExplanation
Unlike other programming languages like Java and others, C++ has no inbuilt interfaces.Q 7. What is similar to the interface in c++?
A. methods
B. pure abstract class
C. instance of a class
D. methods & instance of a class
Show Answer
Answer:-B. pure abstract classExplanation
Pure abstract classes in C++ are a type of interface because it contains only abstract member functions and no data or concrete member functions.Q 8. Which of the following implements the module in the program?
A. header files
B. macro
C. macro & header files
D. interfaces
Leave a Reply