// Program 73: Project Submission Date with Sunday Extension import java.time.*; import java.time.format.*; import java.util.*; class ProjectDueDate { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String raw = sc.nextLine().trim(); String dayName = sc.nextLine().trim(); try { LocalDate given = LocalDate.parse(raw, DateTimeFormatter.ofPattern("dd/MM/uuuu")); if (!given.getDayOfWeek().getDisplayName(java.time.format.TextStyle.FULL, Locale.ENGLISH).equalsIgnoreCase(dayName)) { System.out.println("INVALID DAY NAME"); return; } LocalDate due = given.plusDays(89); if (due.getDayOfWeek() == DayOfWeek.SUNDAY) { due = due.plusDays(1); } System.out.println(due.format(DateTimeFormatter.ofPattern("dd/MM/uuuu"))); System.out.println(due.getDayOfWeek().getDisplayName(java.time.format.TextStyle.FULL, Locale.ENGLISH)); } catch (DateTimeParseException ex) { System.out.println("INVALID DATE"); } } }