New Member FAQ
|
Forums
|
Earn Revenue
Resources
Entrance
Ask Experts
Exam Papers
Jobs
English
Projects
Universities
Colleges
Courses
Schools
Training
My India
Members
|
Communities
|
Business Directory
|
Classifieds
|
Reviews
|
Silverlight Games
|
Peer Appraisal
|
Bookmarks
|
Polls
|
Mentors
|
Links
|
MCA Projects
|
Lobby
|
Gift Shop
|
Chat
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
MVR PURNA ...
(100)
gomathi
(85)
Mr. Anindya
(63)
Last 7 Days
PROSENJIT MANN...
(1978)
Aira
(1431)
Shobha Manasa
(1414)
more...
Awards & Gifts
Online Exams
Aptitude Questions
General Aptitude Tests
Medical Entrance
Engineering Entrance
Bank Tests
TOEFL & IELTS Questions
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.
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
C program that implement Insertion sort to sort a given list of integers in ascending order
C program to implement a STACK
C programs that use both recursive and non-recursive functions To solve Towers of Hanoi problem
C program for Multiple Stack
C++ program : To check whether a given number is palindrome or not
Advertise Here
Contact Us
Advertise
Editors
Privacy Policy
Terms Of Use
ISC Technologies.
2006 - 2009 All Rights Reserved.