CS201 Quiz Introduction to Programming C++ [10]
Question # 1
A friend function 1) : must be having a prototype with no arguments
2) : can access the private data of the class that declares it a friend
3) : cannot access the data members of a class
4) : must be invoked by the class that declares it a friend
Question # 2
A function declaration has the same relationship to a function definition that 1) : a class definition has to an object definition
2) : an object declaration has to an object
3) : a variable has to a variable declaration
4) : a variable declaration has to the variable itself
Question # 3
A friend function 1) : must be having a prototype with no arguments
2) : must be invoked by the class that declares it a friend
3) : must be invoked by an object of the class that declares it a friend
4) : can access the private data of the class that declares it a friend
Question # 4
The reserved words public and private comes under the category 1) : structures
2) : strings
3) : accessibility modifiers
4) : types of functions
Question # 5
The prototype of friend functions must be written ____ the class and its definition must be written ____ 1) : inside, inside the class
2) : inside, outside the class
3) : outside, inside the class
4) : outside, outside the class
Question # 6
In functions that return reference, use __________variables. 1) : Local
2) : Global
3) : Global or static
4) : None of the given option
Question # 7
Operator Overloading is quite similar to Function Overloading. 1) : True
2) : FALSE
3) :
4) :
Question # 8
There are two types of operators to overload: unary and binary. 1) : True
2) : FALSE
3) :
4) :
Question # 9
The declarator of Minus(-) member operator function is 1) : Class-Name operator - (Class-Name rhs)
2) : operator Class-Name - ( )
3) : operator Class-Name - ( rhs)
4) : Class-Name operator - ( )
Question # 10
Operator functions written as non-members but friends of the class, get both the operands as their arguments. 1) : True
2) : FALSE
3) :
4) :