Test Series - cpp

Test Number 73/102

Q: What is the full form of vtable?
A. V type table
B. Vector table
C. Virtual table
D. Virtual-vector table
Solution: Full form of vtable is a virtual table. This is called so because it stores the information about virtual functions of a class.
Q: What is vptr?
A. A hidden pointer in a class that points to a virtual table of that class
B. A hidden pointer in a class that points to virtual functions of that class
C. A hidden pointer in a class that points to virtual members of the class of that class
D. A pointer in a class that points to other class
Solution: vptr is a hidden pointer available with classes which are used to point to the virtual table of a class.
Q: What is the full form of vptr?
A. Vector Pointer
B. Virtual Pointer
C. V type Pointer
D. Virtual-vector Pointer
Solution: vptr is abbreviated for a virtual pointer which is used to point virtual tables of a class.
Q: vptr is _______________
A. a real pointer
B. like this pointer of class
C. passed as a parameter to all functions of class
D. used to resolve self-references
Solution: Unlike this pointer, vptr is a real pointer that points to the virtual table of a class.
Q:  What are the Generators in C++?
A. An object that generates uniformly distributed numbers
B. An object that generates a number from a given sequence
C. An object that generates the smallest number from a given range
D. An object that generates unique numbers
Solution: Generators are objects that generates uniformly distributed numbers which help in generating random numbers.
Q: What are Distributions in C++?
A. Objects that converts a sequence into a sequence having an ascending order
B. Objects that converts a sequence into a sequence having specific random variable distribution
C. Objects that converts a sequence into a sequence having a descending order
D. Objects that converts a sequence into a sequence having only the smallest, largest and median
Solution: Distributions are objects that convert the sequence generated by the generator into a sequence which has a specific random variable distribution like uniform, normal, binomial, etc.
Q: Which header file is used for generating random numbers?
A. 
B. 
C. 
D. 
Solution:  header file is required for using generators and distributions which helps in generating random numbers in a program.
Q: What is Pseudo-random number engines?
A. Uses user input for random number generation
B. Uses an algorithm that does not require any initial seed to generate random numbers
C. Uses initial seed based algorithm to generate random numbers
D. Random number generates depends on the program
Solution: Pseudo-random number engines are used to generate random numbers based on an initial seed provided to them.
Q: How many Pseudo-random number engines are there?
A. 1
B. 2
C. 3
D. 4
Solution: There are three types of Pseudo-random number engines based on the algorithm they use. They are linear_congruential_engine, mersenne_twister_engine and subtract_with_carry_engine.
Q: What are different operations are used in Pseudo-random number engines?
A. operator()
B. min()
C. max()
D. all of the mentioned
Solution: Pseudo-random number engines use three operations operator() that generates a random number, min() that returns minimum value returned by member operator() and max() returns the maximum value.

You Have Score    /10