C++ Programming Questions and Answers – Modularization and Interfaces

This section on C++ Multiple Choice Questions focuses on “Modularization and Interfaces”. One shall practice these questions to improve their C++ programming skills needed for various interviews (campus interviews, walk-in interviews, company interviews), placements, 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.

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
View Answer

Answer: b
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
c) modularization
d) macros
View Answer

Answer: c
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?
a) 1
b) 2
c) 3
d) 4
View Answer

Answer: b
Explanation: There are two types of functions. They are program control and specific task.
advertisement
advertisement

4. How many types of modularization are there in c++?
a) 4
b) 3
c) 1
d) 2
View Answer

Answer: d
Explanation: There are two types of modular programming. They are interface and implementation.

5. What does the client module import?
a) macro
b) records
c) interface
d) instance
View Answer

Answer: c
Explanation: Because they access the functions in the module user interface.
Note: Join free Sanfoundry classes at Telegram or Youtube

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
View Answer

Answer: a
Explanation: Unlike other programming languages like Java and others, C++ has no inbuilt interfaces.

7. What is similar to the interface in c++?
a) methods
b) instance of a class
c) pure abstract class
d) methods & instance of a class
View Answer

Answer: c
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.
advertisement

8. Which of the following implements the module in the program?
a) macro
b) header files
c) macro & header files
d) interfaces
View Answer

Answer: b
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.

advertisement

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.