Font size
WorksheetsC++ Assesment 1
Total questions: 20
Worksheet time: 12mins
A protected member of the class in accessible in
Only same class
Same class and derived class
Outside the class
A virtual function is declared by placing the key word ___ in front of the return type in the base class’s function declaration
virtual
private
public
class
What is the syntax of inheritance of class?
class name
class name : access specifer
class name : access specifer class name
What are mandatory parts in function declaration?
return type,function name
return type,function name,parameters
both a and b
10
20
10,10
When will we use the function overloading?
different function name but same number of arguments
same function name but different number of arguments
same function name but same number of arguments
different function name but different number of arguments
Which of the following explains Polymorphism?
int func(int, int);
float func1(float, float);
int func(int);
int func(int);
int func(float);
float func(int, int, char);
5
55
10
Which of the following operator cannot be overloaded?
+
? :
-
%
What are the actual parameters in C++?
Parameters with which functions are called
Parameters which are used in the definition of a function
Variables other than passed parameters in a function
Variables that are never used in the function
Which of the following is called address operator?
*
&
>>
( )
Destructor are automatically called by the compiler when the object goes out of scope.
True
False
Which of the following provides a reusable mechanism?
Abstraction
Dynamic binding
Inheritance
Encapsulation
Which feature allows you to create a Derived class that inherits properties from more than one Base class?
Multilevel Inheritance
Multiple Inheritance
Hierarchical Inheritance
Hybrid Inheritance
What will be the output of following code ?
error
10
20
________is defined as user defined data type and it also contains functions in it ?
Object
Class
Data members
What is the output ?
firstStr - Programming is fun
Programming is fun
Programming
Programmingisfun
What will be the output?
Value of a:100
Value of b:200
Value of a:200
Value of b:100
Value of a:200
Value of b:200
The constant variable can be declared using (a) keyword.
What are the two Methods of calling functions in C++ program.
(a)
