Test Series - cpp

Test Number 27/102

Q: which of the following is used to implement the c++ interfaces?
A. absolute variables
B. abstract classes
C. constant variables
D. default variables
Solution: 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: 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
Solution: Modularization is also similar to macros but it is used to build large projects.
Q: How many types do functions fall depends on modularization?
A. 1
B. 2
C. 3
D. 4
Solution: There are two types of functions. They are program control and specific task.
Q: How many types of modularization are there in c++?
A. 4
B. 3
C. 2
D. 1
Solution: There are two types of modular programming. They are interface and implementation.
Q: What does the client module import?
A. macro
B. records
C. interface
D. instance
Solution: Because they access the functions in the module user interface.
Q: 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
Solution: Unlike other programming languages like Java and others, C++ has no inbuilt interfaces.
Q: 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
Solution: 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: Which of the following implements the module in the program?
A. macro
B. header files
C. macro & header files
D. interfaces
Solution: We can include the group of code by using the #include header file.
Q: Which operator is used to signify the namespace?
A. conditional operator
B. ternary operator
C. scope operator
D. bitwise operator
Solution: Scope operator(::) is used in namespace syntax.
General syntax:
namespace X{ int a;}
cout<
Q: Identify the correct statement.
A. Namespace is used to group class, objects and functions
B. Namespace is used to mark the beginning of the program
C. A namespace is used to separate the class, objects
D. Namespace is used to mark the beginning & end of the program
Solution: Namespace allows you to group class, objects, and functions. It is used to divide the global scope into the sub-scopes.

You Have Score    /10