Question: Please urgent in java language, i need help in 1 and a half hour Write an inheritance hierarchy that enables polymorphism for the classes defined
Please urgent in java language, i need help in 1 and a half hour
Write an inheritance hierarchy that enables polymorphism for the classes defined in parts 1, 2 and 3. Then implement the driver program defined in part 4.
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 |
Part #4 (20 points)
Write a java application to store information about N Product objects; N is the first input by the user. The user should specify the type of each Product object (1- for LocalProduct and 2- for ImportedProduct), and input the corresponding values using a Scanner object to initialize the objects. (8 points)
Then the program should output the following information (using JOptionPane methods):
- Total price of all products (3 points)
- Names of suppliers of all type 1 local products (3 points)
- Country of origin of all imported products (3 points)
- Information about all products imported from France (3 points)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
