[text] Google

Viewer

  1. import java.util.Scanner;
  2. import java.io.File;
  3. import java.io.IOException;
  4. public class DoPayroll {
  5.     public static void main(String args[])
  6.                                   throws IOException {
  7.         Scanner diskScanner =
  8.             new Scanner(new File("EmployeeInfo.txt"));
  9.         for (int empNum = 1; empNum <= 3; empNum++) {
  10.             payOneEmployee(diskScanner);
  11.         }
  12.         diskScanner.close();
  13.     }
  14.     static void payOneEmployee(Scanner aScanner) {
  15.         Employee anEmployee = new Employee();
  16.         anEmployee.setName(aScanner.nextLine());
  17.         anEmployee.setJobTitle(aScanner.nextLine());
  18.         anEmployee.cutCheck(aScanner.nextDouble());
  19.         aScanner.nextLine();
  20.     }
  21. }

Editor

You can edit this paste and save as new: