Question: Interface Question 2 Interfaces: Product you have two classes that implements the interface Taxable as shown (THIS IS NOT INHERITANCE) Employee Taxable You need to

Interface Question 2 Interfaces: Product you have two classes that implements the interface Taxable as shown (THIS IS NOT INHERITANCE) Employee Taxable You need to write a full java program that has the Following: 1- Interface Taxable that has only one method calculateTaxes() returns double 2. Product class that implements the interface Taxable and has 2 variables name and price both cannot be changed. Apply taxes to the products using the interface. The taxation rate is 10% for the products (use the formula price *0.1). Product class will also have a toString method to print the product details Product Name: Panadol Price: 5 Taxes: 0.5 3. Employee class that implements the interface Taxable and has 2 variables name and salary both cannot be changed. Apply taxes to the employee salary using the interface. The taxation rate is 5% for the salary (use the formula salary*0.05). Employee class will also have a toString method to print the Employee details Employee Name: Joe Biden Salary: 1000 Taxes: 50 4- Show in a main class how the taxes can be calculated polymorphically. Create an array of 2 Taxable Object (1 product and 1 employee) with any information. Print the details of the objects using an enhanced for loop. Your final output should look like this: Product Name: Panadol Price: 5 Taxes: 0.5 Employee Name: Joe Biden Salary: 1000 Taxes: 50
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
