The input is a text file with every line being some piece of information, in the following format:
typeOfEmployee - Salaried, Hourly, etc.
SSN
lastName, firstName
addressLine1
addressLine2
filingStatus-exemptions
...employee specific lines...such as hours, totalPay, benefitAdjustment, etc.
nextEmployee
etc.
etc.
nextEmployee
etc.
etc.
I'm using Windows XP SP2 and have the most current JDK.
Expand|Select|Wrap|Line Numbers
- import java.util.*;
- import java.util.regex.*;
- public final class Driver {
- public static Employee[] employees = new Employee[1024];
- public static int employeeCount;
- public static void main( String[] args ) {
- Scanner s = new Scanner(System.in);
- s.useDelimiter("\r\n");
- while (s.hasNext()) {
- String line = s.next();
- if (line.equals("")) {
- continue;
- } else if (line.equals("SALARIED")) {
- String[] lines = new String[8];
- for (int k = 0; k < 8; k++) {
- lines[k] = s.next();
- }
- employees[employeeCount++] = new Salaried(lines);
- } else if (line.equals("HOURLY")) {
- String[] lines = new String[8];
- for (int k = 0; k < 8; k++) {
- lines[k] = s.next();
- }
- employees[employeeCount++] = new Hourly(lines);
- } else if (line.equals("TEMP")) {
- String[] lines = new String[8];
- for (int k = 0; k < 8; k++) {
- lines[k] = s.next();
- }
- employees[employeeCount++] = new Temp(lines);
- }
- } System.out.println(employees[0].getTotalPay());
- }
- }
I keep getting a "cannot find symbol" error with the symbol being the getTotalPay() method and it says the location is in the Employee class. Any suggestions for a beginning programmer? Look at line 66.