public static void main(String[] args) { FinalProject finalProject = new FinalProject(); ArrayList list = new ArrayList<>(100); Scanner scanner = new Scanner(System.in); int choice; do { try { System.out.println(); System.out.println("Choose one of the options:"); System.out.println("1- Enter the information of a faculty"); System.out.println("2- Enter the information of a student"); System.out.println("3- Print tuition invoice for a student"); System.out.println("4- Print faculty information"); System.out.println("5- Enter the information of a staff member"); System.out.println("6- Print the information of a staff member"); System.out.println("7- Delete a person"); System.out.println("8- Exit Program"); System.out.println(); System.out.print("Enter your choice: "); System.out.println(); choice = scanner.nextInt(); switch (choice) { case 1: System.out.println("Enter the faculty info:"); System.out.print("Name: "); String name = scanner.next(); String id; do { System.out.print("id: "); id = scanner.next(); if (idformat(id)&&duplicateCheck(id,list)==false) { break; } else {System.out.println("Invalid ID format or duplicate id.");} }while (1!=0); Scanner scanner2 = new Scanner(System.in); String rank; do { System.out.print("Rank: "); rank = scanner2.next().toUpperCase(); if (rank.equals("PROFESSOR") || rank.equals("ADJUNCT")) { break; } else {System.out.println(rank+" is an invalid rank.");} }while (1!=0); String department; do { System.out.print("Department: "); department = scanner.next().toUpperCase(); if (department.equals("MATHEMATICS") || department.equals("ENGLISH") || department.equals("ENGINEERING")) { break; } else {System.out.println(department+" is an invalid department.");} }while (1!=0); Faculty faculty = finalProject.new Faculty(name, id, department, rank); list.add(faculty); break; case 2: System.out.println("Enter the student info:"); System.out.print("Name: "); String studentname = scanner.next(); String studentid; do { System.out.print("Id: "); studentid = scanner.next(); if (idformat(studentid)&&duplicateCheck(studentid,list)==false) { break; } else {System.out.println("Invalid ID format or duplicate id.");} }while (1!=0); double gpa; do { System.out.print("Gpa: "); gpa = scanner.nextDouble(); if (gpa >= 0 && gpa <= 4.5) { break; } else {System.out.println("Please enter a gpa between 0 and 4.5.");} }while (1!=0); int credits; do { System.out.print("Credit Hours: "); credits = scanner.nextInt(); if (credits >= 0 && credits <= 100) { break; } else {System.out.println("Please enter a reasonable number of credits.");} }while (1!=0); Student student = finalProject.new Student(studentname,studentid,gpa,credits); list.add(student); break; case 3: System.out.println("Enter the Student's id:"); Scanner scanner5 = new Scanner(System.in); System.out.println(""); System.out.println(""); String object3 = scanner5.next(); boolean found3 = false; for (Person person : list) { if (person.getId().equals(object3)) { found3 = true; person.print(); break; }} if (!found3) { System.out.println(object3 + " not found."); } break; case 4: System.out.println("Enter the Faculty’s id:"); String object = scanner.next(); boolean found = false; for (Person person : list) { if (person.getId().equals(object)) { found = true; person.print(); break; }} if (!found) { System.out.println(object + " not found."); } break; case 5: System.out.println("Enter the Staff Member's info:"); System.out.println(""); System.out.print("Name: "); String staffname = scanner.next(); String staffid; do { System.out.print("Id: "); staffid = scanner.next(); if (idformat(staffid)&&duplicateCheck(staffid,list)==false) { break; } else {System.out.println("Invalid ID format or duplicate id.");} } while (1!=0); String staffdepartment; do { System.out.print("Department: "); staffdepartment = scanner.next().toUpperCase(); if (staffdepartment.equals("MATHEMATICS") || staffdepartment.equals("ENGLISH") || staffdepartment.equals("ENGINEERING")) { break; } else {System.out.println(staffdepartment+" is an invalid department.");} } while (1!=0); Scanner scanner3 = new Scanner(System.in); String status; do { System.out.print("Status ('Full Time' or 'Part Time'): "); status = scanner3.nextLine().toUpperCase(); if (status.equals("PART TIME") || status.equals("FULL TIME") ) { break; } else {System.out.println("Status must be 'Part Time' or 'Full time'.");} } while (1!=0); Staff staff = finalProject.new Staff(staffname, staffid, staffdepartment,status); list.add(staff); break; case 6: Scanner scanner4 = new Scanner(System.in); System.out.println("Enter the Staff Member's id:"); System.out.println(""); String object2 = scanner4.next(); boolean found2 = false; for (Person person : list) { if (person.getId().equals(object2)) { found2 = true; person.print(); break; }} if (!found2) { System.out.println(object2 + " not found."); } break;