// Helene Martin, CSE 143 // This program hires and fires teaching assistants based on their experience. // A PriorityQueue is used to order the TAs based on experience. import java.io.*; import java.util.*; public class TAManager { public static void main(String[] args) throws FileNotFoundException { Scanner taFile = new Scanner(new File("tas.txt")); Queue tas = new PriorityQueue(); while (taFile.hasNext()) { String name = taFile.next(); int experience = taFile.nextInt(); TeachingAssistant ta = new TeachingAssistant(name, experience); tas.add(ta); } System.out.println(tas); // NOT in any particular order System.out.println(tas.peek()); // minimum value while (tas.peek().getExperience() <= 2) { tas.remove(); } System.out.println(tas); while (!tas.isEmpty()) { System.out.println(tas.remove()); } } }