Part A Write an application called PastPresentFuture that uses the LocalDate class to access the current date. Prompt a user for a month, day, and year. Display a message that specifies whether the entered date is (1) not this year, (2) in an earlier month this year, (3) in a later month this year, or (4) this month. An example of the program is shown below: Enter a month >> 7 Enter a day >> 20 Enter a year (four digits) >> 2021 7 is this month Part B Copy the code from your PastPresentFuture program into PastPresentFuture2. 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 day is in the past, the current date, or in the future. Task 01: Create the PastPresentFuture class. Task 02: The program returns the correct response for a date matching the current month. Task 03: The program returns the correct response for a date in the past. Task 04: The program returns the correct response for a date in the future. Task 05: The program returns the correct response for a date not in the current year. Task 06: Create the PastPresentFuture2 class. Task 07: The PastPresentFuture2 program implements isBefore(), isAfter(), or equals().
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Part A
Write an application called PastPresentFuture that uses the LocalDate class to access the current date.
Prompt a user for a month, day, and year. Display a message that specifies whether the entered date is (1) not this year, (2) in an earlier month this year, (3) in a later month this year, or (4) this month.
An example of the
Enter a month >> 7
Enter a day >> 20
Enter a year (four digits) >> 2021
7 is this month
Part B
Copy the code from your PastPresentFuture program into PastPresentFuture2. 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 day is in the past, the current date, or in the future.
Task 01: Create the PastPresentFuture class.
Task 02: The program returns the correct response for a date matching the current month.
Task 03: The program returns the correct response for a date in the past.
Task 05: The program returns the correct response for a date not in the current year.
Task 06: Create the PastPresentFuture2 class.
Task 07: The PastPresentFuture2 program implements isBefore(), isAfter(), or equals().
Step by step
Solved in 3 steps with 2 images