Question: package ics 1 2 5 _ example _ 0 2 ; public class CommissionEmployee extends Employee { private double grossSales; private double commissionRate; public CommissionEmployee

package ics125_example_02;
public class CommissionEmployee extends Employee {
private double grossSales;
private double commissionRate;
public CommissionEmployee(String firstName, String lastName,
double grossSales,
double commissionRate){
super(firstName, lastName);
this.grosssales = gross5ales;
this commissionRate = commissionRate;
}
@override
public float calculatePay(){
// return the biweekly earnings for a commission employee
I*
Confirm commission rate is between 0.0 and 1.0.
If the rate is not between . and 1., set the rate to zero.
Confirm the gross sales is larger than 0.0.
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 ic5125_example_02;
public class ICS125_Example_020
public static void main(String[] args){
// track the total amount paid for all employees.
float total =;
Employee[] office new SalaryEmployee ("Bill", "Brown", 2),
new CommissionEmployee("Sue", "Black", 1000,0.1),
new CommissionEmployee("Pat", "Green", 2000,0.2),
new SalaryEmployee("Amy", "Redd", 3)
};
System.out.printf("Payment this period:%n");
/) Print for each employee:
Emplayee Bill Brown earns $250.00
etc.
System.out.printf("Total pay out is %7.2%%", total);
}
}??? end class ISC125_Example_82
 package ics125_example_02; public class CommissionEmployee extends Employee { private double grossSales;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!