Here is a listing of C++ Questions & Answers focuses on “Modularization and Interfaces” along with answers, explanations and/or solutions:
1. which of the following is used to implement the c++ interfaces?
a) absolute variables
b) abstract classes
c) constant variables
d) default variables
Explanation: 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.
2. What is the ability to group some lines of code that can be included?
in the program?
a) specific task
b) program control
Explanation: Modularization is also similar to macros but it is used to build large projects.
3. How many types do functions fall depends on modularization?
Explanation: There are two types of functions. They are program control and specific task.
4. How many types of modularization are there in c++?
Explanation: There are two types of modular programming. They are interface and implementation.
5. What does the client module import?
Explanation: Because they access the functions in the module user interface.
6. Identify the correct statement.
a) c++ does not have built-in interfaces
b) c++ does have built-in interfaces
c) c++ have no concept of interfaces
d) c++ does have built-in interfaces & classes
Explanation: Unlike other programming languages like Java and others, C++ has no inbuilt interfaces.
7. What is similar to the interface in c++?
b) instance of a class
c) pure abstract class
d) methods & instance of a class
Explanation: Pure abstract classes in C++ are a type of interface because it contains only abstract member functions and no data or concrete member functions.
8. Which of the following implements the module in the program?
b) header files
c) macro & header files
Explanation: We can include the group of code by using the #include header file.
To practice all areas of C++ language, here is complete set of 1000+ Multiple Choice Questions and Answers.