import java.util.LinkedList; import java.util.Scanner; public class Agency { private Administrator loggedInUser; private Destinations destinations; private Flights flights; private Administrators admins; public Agency() { admins = new Administrators(); admins.insertDummyData(); destinations = new Destinations(this); flights = new Flights(this); } public Destinations getDestinations() { return destinations; } public Flights getFlights() { return flights; } public void login() { Scanner scanner = new Scanner(System.in); boolean loggedIn = false; while (!loggedIn) { System.out.print("Username: "); String username = scanner.nextLine(); System.out.print("Password: "); String password = scanner.nextLine(); if (admins.validateCredentials(username, password)) { loggedIn = true; loggedInUser = new Administrator(admins.getAdminName(username), username, password); mainMenu(scanner); } else { System.out.println("Invalid Credentials! Try Again."); } } } public void destinationsMenu(Scanner scanner) { System.out.println("Welcome to the Destinations section " + loggedInUser.getName() + ", Please make a selection from the menu:"); while (true) { System.out.println("1. View All Destinations"); System.out.println("2. View Destinations by Country"); System.out.println("3. Add a Destination"); System.out.println("4. Remove a Destination"); System.out.println("X. Return to Main Menu"); System.out.print("Please enter an option: "); String option = scanner.nextLine(); switch (option) { case "1": destinations.displayAllDestinations(); break; case "2": break; case "3": break; case "4": break; case "X": mainMenu(scanner); return; default: System.out.println("Please enter a valid choice, or press X to exit."); } } } public void mainMenu(Scanner scanner) { System.out.println("Welcome to the Prog2 Travel Agency " + loggedInUser.getName() + ", Please make a selection from the menu:"); while (true) { System.out.println("1. Explore Flights"); System.out.println("2. Explore Destinations"); System.out.println("3. Book a Trip"); System.out.println("X. Exit the System"); System.out.print("Please enter an option: "); String option = scanner.nextLine(); switch (option) { case "1": break; case "2": destinationsMenu(scanner); break; case "3": break; case "X": System.out.println("Thanks for using the Prog2 Travel Agency."); System.exit(0); default: System.out.println("Please enter a valid choice, or press X to exit."); } } } public static void main(String[] args) { Agency agency = new Agency(); agency.login(); } } public class Destination { private String country; private String name; public Destination(String name, String country) { this.name = name; this.country = country; } public String getCountry() { return country; } public String getName() { return name; } } import java.util.LinkedList; public class Destinations { private LinkedList destinations; private Agency agency; public Destinations(Agency agency) { this.agency = agency; destinations = new LinkedList<>(); destinations.a.