// Tyler Rigsby, CSE 142 // Reads in a file of TAs and the number of hours they worked and prints // their total hours worked import java.util.*; import java.io.*; public class HoursWorked { public static void main(String[] args) throws FileNotFoundException { Scanner input = new Scanner(new File("hours.txt")); while (input.hasNextLine()) { String line = input.nextLine(); Scanner lineScan = new Scanner(line); int id = lineScan.nextInt(); String name = lineScan.next(); double hours = 0.0; while (lineScan.hasNextDouble()) { hours += lineScan.nextDouble(); //hours = hours + lineScan.nextDouble(); } System.out.println(name + " worked " + hours + " hours."); } } }