Derive the two classes son and daughter from the above

Assignment Help C/C++ Programming
Reference no: EM131097447

Program

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<<endl;}
};

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 and then calls iam() for them. Declare pointer and in each case call iam() through the pointer to demonstrate polymorphism in action.

Reference no: EM131097447

Questions Cloud

Lower output and higher price than perfect competition : What is the rule for utility maximising? Explain why monopoly leads to a lower output and higher price than perfect competition?
The company follows a pure residual dividend policy : 2. Lindsey Insurance Co. has current sales of $10 million and predicts next year's sales will grow to $14 million. Current assets are $3 million and fixed assets are $4 million. The firm's net profit margin is 7 percent after taxes.
Find the cournot equilibrium : Suppose in the Cournot model that the firms have different production costs. Let c1 and c2 be the costs of production per unit for firms 1 and 2 respectively, where both c1 and c2 are assumed less than 1/2. Find the Cournot equilibrium.
Market for product or service was affected by change : Give a real example in history when a market for a product or service was affected by a change in each of the following: Income of buyers Price of a related good, either a substitute or compliment Number of buyers Consumer preferences and information..
Derive the two classes son and daughter from the above : 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 thre..
How siemens come up with innovative new energy technologies : Which renewable energy resources should Siemens Energy invest in? How should Siemens come up with innovative new energy technologies? Develop them? Create strategic alliances? Acquire other companies?
Find the cyclostationary function : Show that no spectra lines can be observed in the power spectral density.
His average tax rate for his entire income : Suppose George made $20,000 last year and he lives I n the country of Harmony. The way Harmony levies income taxes, each citizen must pay 10% in taxes on their first $10,000 in earnings and then 50% in taxes on anything else they may earn. So given t..
Primary economic issues and policies : Compare and contrast the primary economic issues and policies both the Republican and Democrat parties address concerning the U.S. healthcare delivery system overall. Provide at least one (1) example of an economic and / or policy issue to supp..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Putting objects within objects is the essence of composition

Putting objects within objects is the essence of composition. It is called composition for obvious reasons. As we always say that if something is made from other things that it is composed from those things.

  Write a program that asks the user for a profile name

Write a program that asks the user for a profile name and displays the number of characters, words, and lines in that file. Then have the program ask for the name of the next file. When the user enters a file that doesn't exist (such as the empty ..

  Implement a function which finds the largest number

Write a function named largest which will receive the array as input and return the variable LargestNumber.

  Insert the missing code in the c program

You are to insert the missing code in the C program given for combinational equivalence checking. This program will interface with the CUDD package and will parse netlist files in ISCAS85 circuit format. Next, BDDs will be created for each circuit an..

  Write a c program that asks for and reads in two integers

Write a C program that asks for and reads in two integers and then reports if one is a multiple of the other.

  Five elements similar to having different variables

How is an array with five elements similar to having five different variables?

  Display the list of all car record

Sales and Profits - show car model, the number of car in stock, car sold, unit cost, selling price and the profit for each car and the total profit for all cars.

  Floating point values into an array

Write a program that allows a user to enter 10 floating point values into an array. Then, in a loop, the program should prompt the user for a desired precision and subsequently display each value to the correct precision.

  Which pieces of information can be found in the ip header

There are eight network security questions. I have answered the questions however, I am unclear if I am correct. Please review and if I am wrong, please provide the correct answer along with your explanation.

  Find the prime numbers

Write a c++ program to find the prime numbers

  Function odd_fill() that fills all integers between two poin

write a function odd_fill() that fills all integers between two pointers, first and last, with a sequence of odd integers: 1,3,5,7

  Determine frequency of each character found in the array

Determines the frequency of each character found in the array - array of pointers to strings and the number of strings as arguments

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd