Object Oriented Programming in C++
Object Oriented Programming in C++
Candidates are required to give their answers in their own words as far
as practicable.
The figures in the margin indicate full marks.
Attempt all the questions.
1
constructors to initialize the data members. Overload the > operator
(greater than). One player is considered greater than another if the
sum of goals plus assists is greater than that of the others. Create an
array of 11 soccer players, then use the overloaded > operator to find
the player who has the greatest total of goals plus assists.
b) How can you achieve run time polymorphism in C++? Discuss with a 7
suitable example.
6. a) Define a class called stack and implement generic methods to push 8
and pop the elements from the stack.
b) Path-follower Robot: 7
A Path-follower Robot senses the path it needs to follow thru its
sensors. Based on the data received thru its sensors, the Robot makes
use of its actuators (Robotic Wheels) to steer itself forward. For the
above mentioned system, identify as many components (collaborating
objects) as you can, draw CRC card for at least three of them and
show the interaction between these components thru an interaction
diagram.
7. Write short notes on: (Any two) 2×5
a) Responsibility Driven Design.
b) Stack versus Heap Based Allocation.
c) Virtual functions.