How can we simulate the concept of multiple inheritance, C/C++ Programming

Assignment Help:

Problem:

(a) Using a class hierarchy of your own choosing, with at least TWO subclass levels, show

(i) the use of abstract and concrete forms of Java class and method in your hierarchy.

(ii) the role and purpose of constructors in each level of your hierarchy.

(iii) the meaning of 'polymorphism'.

In your answer, it should be clearly and fully explained how the proposed class structure is reflected in Java language and constructs.

(b) (i) Consider a class ‘Employee'. Given the knowledge we have of some of the different categories of employees like permanent salaried employees, commission employees, etc, write the sample code in Java to represent the class ‘Employee' such that it forms part of a hierarchy with subclasses.

Note: The class Employee should have different other classes inheriting from it at more than one level.

(ii) Use this same example to explain how we can simulate the concept of multiple inheritance in Java by using interfaces. Here we should make the ‘Employee' our interface.


Related Discussions:- How can we simulate the concept of multiple inheritance

Differentiate between the expression ++a and a++, Differentiate between the...

Differentiate between the expression "++a" and "a++"? - With ++a, increment happens first on variable a, and resulting value is used. This is known as prefix increment. - Wi

What are compound statements, What are compound statements? - Compound ...

What are compound statements? - Compound statements are made up of two or more program statements that are executed together. They may be executed with a loop. - Curly brack

Explain about evaluation of expression in c language, Explain about Evaluat...

Explain about Evaluation of Expression in c language? An Expressions are evaluated using an assignment statement of the form: variable = expression; The Variable is any v

Explanation of break statement, Problem 1. Explain Break and continue s...

Problem 1. Explain Break and continue statements in C++. Explanation of Break statement Explanation of Continue statement 2. Explain concepts of constructors and

Assign random integers to the variable, (Random Numbers) Write statements t...

(Random Numbers) Write statements that assign random integers to the variable n in the following ranges: a) 1 ≤ n ≤2 b) 1 ≤ n ≤100 c) 0 ≤ n ≤9 d) 1000 ≤ n ≤1112 e)

Explain class templates, Class Templates In addition to function  templ...

Class Templates In addition to function  templates, C++  also supports the  method of class templates. By definition, a class template is a class definition that explains a fam

Example for external storage class - computer programming, Example for exte...

Example for external storage class - computer programming? extern double sin (double); In a function prototype, for the sin() function its function definition ~ we can write

Wap to print numbers from 1-50 which are divided by 7, WAP TO PRINT NUMBERS...

WAP TO PRINT NUMBERS FROM 1-50 WHICH ARE DIVIDED BY 7 void main () { int a; clrscr (); a=1; while (a { if (a%7==0) printf ("%d\n",a); a++; } ge

Write Your Message!

Captcha
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