import java.io.*; public class HourlyCompany extends Company { /** * Initializes this HourlyCompany object. * */ public HourlyCompany () { } /** * Determines the best-paid, non-overtime, hourly employee in this * HourlyCompany object. * */ public void findBestPaid () throws IOException // see Section 2.2 { final String SENTINEL = "***"; final String INPUT_PROMPT = "\n\nPlease enter a name, with no " + "blanks, hours worked and pay rate. The sentinel is " + SENTINEL + " "; HourlyEmployee hourly; String line; BufferedReader reader = new BufferedReader (new InputStreamReader (System.in)); while (true) { System.out.print (INPUT_PROMPT); line = reader.readLine(); if (line.equals (SENTINEL)) break; hourly = new HourlyEmployee (line); if (hourly.makesMoreThan (bestPaid)) { bestPaid = hourly; atLeastOneEmployee = true; } // if hourly employee earns more than bestPaid } // while } // findBestPaid } // class HourlyCompany