Showing posts with label virtual. Show all posts
Showing posts with label virtual. Show all posts

Thursday, September 13, 2012

Virtual Function Implementation in C++ Programming

Virtual Function Implementation in C++ Programming

Question:
Write a base class called Employee. Use this class to store values name, salary etc.
Derive three specific classes called Manager, Teamleadand Programmer. Add to the
base class, a member function get_data() to initialize base class data members and
another function display() to compute and display information . Make display() as a
virtual function and redefine this function in the derived classes to suit their
requirements.