Use the web to learn how to use the LocalDate Boolean methods isBefore(), isAfter(), and equals(). Use your knowledge to write a program that prompts a user for a month, day, and year, and then...


Use the web to learn how to use the LocalDate Boolean methods isBefore(), isAfter(), and equals(). Use your knowledge to write a program that prompts a user for a month, day, and year, and then displays a message specifying whether the entered dayis in the past,is today (the current date), oris in the future.



import java.util.*;

import java.time.*;

public class PastPresentFuture2

{

publicstaticvoidmain (Stringargs[])

{

LocalDate today = LocalDate.now();

LocalDate enteredDate;

int mo, da, yr;

int todayMo, todayDa, todayYr;

Scanner input =newScanner(System.in);

System.out.print("Enter a month >> ");

mo = input.nextInt();

System.out.print("Enter a day >> ");

da = input.nextInt();

System.out.print("Enter a year (four digits) >> ");

yr = input.nextInt();



// Write your code here



}

}







Jun 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here