package chapter2; public class Employee { private String name; private double hourlyPay; private double percentCommission; //between 0 and 1, bonus per item sold //constructor public Employee(String firstName, double payRate, double commission) { name = firstName; hourlyPay = payRate; percentCommission = commission; } //calculate payment for this month public double getWeeklyPayment(int hoursWorked, int itemsSold) { double payment = hoursWorked*hourlyPay; double addedCommission = itemsSold*percentCommission; payment += addedCommission; return payment; } //methods to access the variables of this class public double getPayRate() { return hourlyPay; } public String getName() { return name; } }