New Member FAQ | Forums | Earn Revenue


Resources Entrance Ask Experts Exam Papers Jobs English Projects Universities Colleges Courses Schools Training My India



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



Overloading concept


Posted Date:     Total Responses: 0    Posted By: Rajat Saini   Member Level: Silver   Points/Cash: 4   


Consider the following class definition
class father {
protected : int age;
public;
father (int x) {age = x;}
virtual void iam ( )
{ cout < < “I AM THE FATHER, my age is : ”<< age<< end1:}
};
Derive the two classes son and daughter from the above class and for each, define iam ( ) to write
our similar but appropriate messages. You should also define suitable constructors for these
classes.
Now, write a main ( ) that creates objects of the three classes and then calls iam ( ) for them.
Declare pointer to father. Successively, assign addresses of objects of the two derived classes to
this pointer and in each case, call iam ( ) through the pointer to demonstrate polymorphism in
action.

Attachments

  • Source Code (2447-221226-RATIO_2.CPP)

  • Project Feedbacks


    No feedbacks found. Be the first to respond and make money from revenue sharing program.

    Post Feedback
    You must Sign In to post a feedback.
    Next Project: Hospital Database
    Previous Project: File Handling in C++

    Return to Project Index

    Post New Project


    Related Projects



    Advertise Here





    Contact Us   Advertise   Editors    Privacy Policy    Terms Of Use   

    ISC Technologies.
    2006 - 2009 All Rights Reserved.