Futuresoft Previous Years Solved Sample Placement Papers
-
Which of the following is the correct class of the object
cout
?A: iostream
B: istream
C: ostream
D: ifstream
Ans: C -
Which of the following cannot be used with the keyword
virtual
?A: class
B: member functions
C: constructor
D: destructor
Ans: C -
Which of the following problem causes an exception?
A: Missing semicolon in statement in
main()
.B: A problem in calling function
C: A syntax error
D: A run-time error
Ans: D -
Which one of the following options is correct about the statement given below? The compiler checks the type of reference in the object and not the type of object.
A: Inheritance
B: Polymorphism
C: Abstraction
D: Encapsulation
Ans: B -
What will be the output of the following program?
#include <iostream.h> void main() { float x; x = (float)9/2; cout << x; }
A: 4.5
B: 4.0
C: 4
D: 5
Ans: A -
The term __________ means the ability to take many forms.
A: Inheritance
B: Polymorphism
C: Member function
D: Encapsulation
Ans: B -
Runtime polymorphism is achieved by
A: Friend function
B: Virtual function
C: Operator overloading
D: Function overloading
Ans: B -
Access to private data
A: Restricted to methods of the same class
B: Restricted to methods of other classes
C: Available to methods of the same class and other classes
D: Not an issue because the program will not compile
Ans: B -
Additional information sent when an exception is thrown may be placed in
A: The throw keyword
B: The function that caused the error
C: The catch block
D: An object of the exception class
Ans: C -
A static data member is given a value
A: Within the class definition
B: Outside the class definition
C: When the program is executed
D: Never
Ans: D -
In a class specifier, data or function designated private are accessible
A: To any function in the program
B: Only if you know the password
C: To member functions of that class
D: Only to public members of the class
Ans: C -
Which of the statements are true?
I. Function overloading is done at compile time.
II. Protected members are accessible to the member of derived class.
III. A derived class inherits constructors and destructors.
IV. A friend function can be called like a normal function.
V. Nested class is a derived class.
A: I, II, III
B: II, III, V
C: III, IV, V
D: I, II, IV
Ans: D