013-003-009
Manipulating Dates with LocalDate
Medium
Problem Description
Manipulating Dates with LocalDate
In this problem, you will create a program that generates a date object from input year, month, and day using the LocalDate class, calculates the date 30 days later along with its day of the week, and displays the result to standard output.
Learning Objective: Understand the basics of creating, adding to, and comparing dates with LocalDate
Overview
Use LocalDate to calculate the date 30 days after a given date and output the day of the week.
Specifications
- Read year, month, day as integers from Scanner (one per line)
- Create a date object with
LocalDate.of() - Print
Original: <date>in YYYY-MM-DD format - Calculate 30 days later with
plusDays(30)and printAfter 30 days: <date> - Print
Day of week: <day name>(English day name)
Input Example
2025
1
1
Output Format
Original: 2025-01-01
After 30 days: 2025-01-31
Day of week: FRIDAY
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up