MABS Institution
11th Computer Science Weekly Test -4 ( Polymorphism )-Aug 2020
-
-
-
-
-
-
Which of the following means a name having two or more distinct meanings?
Abstraction
Overridding
Overloading
data binding
-
In which of the following functions in the same scope that share the same name but their parameters are different?
function overloading
operator overloading
data overloading
Data hiding
-
Which of the following statement is true or false?
(i) Overloading function refers to a functions having more than one distinct meaning
(ii) The number and types of a function parameters are called overloaded signaturei-true, ii-true
i-true, ii-false
i-false, ii-false
i-false, ii-true
-
How will you invoke the function dispchar() for the following input?
To print Dollar for 10 times
void dispchar(char ch='$';int size=10)
{
for(int i=1;i < = size;i++)
cout << ch
}
dispchar ();
dispchar( ch,size);
dispchar($,10);
dispchar('$',10 times);
-
What is operator overloading? Give some example of operators which can be overloaded.
-
Discuss the benefit of constructor overloading?
-
class sale ( int cost, discount ;public: sale(sale &); Write a non inline definition for constructor specified;
-
What is the output of the following program:
#inclue
using namespace std;
void print(int i)
{cout << " it is Integer" << l << endl;}
void print(double f)
{cout << '' It is fioat" << f << endl;}
void print(string c)
{cout << '' it is string'' << c << endl;}
int main 0 {
print(10);
print(10.10);
print("Ten ");
return 0;
} -
-
Write a short note on operator overloading.
-
What is function signature?
-
-
What are the rules for function overloading?
-
How does a compiler decide as to which function should be invoked when there are many functions? Give an example.