Answered step by step
Verified Expert Solution
Link Copied!

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 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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

Students also viewed these Databases questions