Question: The LocalDate class describes a calendar date that does not depend on a location or time zone. You construct a date like this: Your task

The LocalDate class describes a calendar date that does not depend on a location or time zone. You construct a date like this:

LocalDate today = LocalDate.now(); // Today's date LocalDate eckertsBirthday LocalDate.of (1919, 4,

Your task is to write a program that prints • The weekday of “Pi day”, that is, March 14, of the current year.
• The date and weekday of “Programmer’s day” in the current year; that is, the 256th day of the year. (The number 256, or 28, is useful for some programming tasks.)
• The date and weekday of the date that is 10,000 days earlier than today.

LocalDate today = LocalDate.now(); // Today's date LocalDate eckertsBirthday LocalDate.of (1919, 4, 9); The plusDays method can be used to add a number of days to a LocalDate object: LocalDate later = today.plusDays (10); // Ten days from today This method does not mutate the today object, but it returns a new object that is a given number of days away from today. To get the year of a day, call int year = today.getYear(); To get the weekday of a LocalDate, call String weekday today.getDayOfWeek ().toString();

Step by Step Solution

3.45 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To accomplish the tasks outlined in the question we can write a Java program using the LocalDate class and its methods The following is the stepbystep ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming Questions!