Answered step by step
Verified Expert Solution
Question
1 Approved Answer
package ics 1 2 5 _ example _ 0 2 ; public class CommissionEmployee extends Employee { private double grossSales; private double commissionRate; public CommissionEmployee
package icsexample;
public class CommissionEmployee extends Employee
private double grossSales;
private double commissionRate;
public CommissionEmployeeString firstName, String lastName,
double grossSales,
double commissionRate
superfirstName lastName;
this.grosssales grossales;
this commissionRate commissionRate;
@override
public float calculatePay
return the biweekly earnings for a commission employee
I
Confirm commission rate is between and
If the rate is not between and set the rate to zero.
Confirm the gross sales is larger than
If the gross sales is less than set the gross sales to zero.
Calculate the earnings to be the rate times the sales.
end class CommissionEmployee
package icexample;
public class ICSExample
public static void mainString args
track the total amount paid for all employees.
float total ;
Employee office new SalaryEmployee Bill "Brown",
new CommissionEmployeeSue "Black",
new CommissionEmployeePat "Green",
new SalaryEmployeeAmy "Redd",
;
System.out.printfPayment this period:n;
Print for each employee:
Emplayee Bill Brown earns $
etc.
System.out.printfTotal pay out is total;
end class ISCExample
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started