import java.util.Scanner; public class CommissionedEmployee extends Employee { private double commissionRate; public CommissionedEmployee(double aRate) { super(); commissionRate = aRate; } // Overridden behavior public void eat() { System.out.println("On a commission, busy, busy, busy...eating on the go!"); } // Implements the abstract method of parent public double calculateEarnings() { double sales; double earnings; Scanner in; in = new Scanner(System.in); System.out.print("Total value of items that you sold: "); sales = in.nextDouble(); earnings = sales * commissionRate; return(earnings); } public String toString() { String allFields; allFields = super.toString(); allFields = allFields + "\tCommission rate: " + commissionRate + "\n"; allFields = allFields + "---------------------" + "\n"; return(allFields); } }