Posted By

trusktr on 10/17/10


Tagged

java payroll employees


Versions (?)

cisp401 Main.java


 / Published in: Java
 

The AppDriver for my employee payroll app.

  1. import java.io.*;
  2.  
  3. public class Main { //source: Main.java
  4. public static void main(String[] args) {
  5. System.out.print("Enter the location of your employee data file: ");
  6.  
  7. MyString filename = null;
  8. try {
  9. filename = new MyString(""+ br.readLine());
  10. }
  11. catch (IOException ioe) {
  12. System.out.println("IO error while trying to read your input!");
  13. System.exit(1);
  14. }
  15.  
  16. File f = new File(""+ filename);
  17. Employees starbucksEmps = new Employees(f);
  18.  
  19. PayrollApp payroll = new PayrollApp(starbucksEmps);
  20.  
  21. starbucksEmps.sort();
  22.  
  23. System.out.println(""); // NEW LINE
  24. System.out.println(starbucksEmps);
  25. System.out.println(""); // NEW LINE
  26. System.out.println(payroll.tableHeader());
  27. for (int i=0; i<starbucksEmps.size(); i++) {
  28. System.out.println((payroll.tableRows())[i]);
  29. }
  30. System.out.println(""); // NEW LINE
  31. System.out.println(payroll.totalsRow());
  32. System.out.println(payroll.averagesRow());
  33. System.out.println(""); // NEW LINE
  34. }
  35. }

Report this snippet  

You need to login to post a comment.