Question: Write an inheritance hierarchy that enables polymorphism for the classes defined in parts 1, 2 and 3. Part #1 (20 points) Product (an abstract class)
Write an inheritance hierarchy that enables polymorphism for the classes defined in parts 1, 2 and 3.
Part #1 (20 points)
| Product (an abstract class) (1 point) | |
| Attributes |
|
| Methods |
|
Part #2 (20 points)
| LocalProduct (a Product) (2 points) | |
| Attributes |
|
| Methods |
5% if type is equal to 1 8% if type is equal to 2 |
Part #3 (20 points)
| ImportedProduct (a Product) (2 points) | |
| Attributes |
|
| Methods |
5% of basic price if country of origin is USA Amount of tariff |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
