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

  1. Read year, month, day as integers from Scanner (one per line)
  2. Create a date object with LocalDate.of()
  3. Print Original: <date> in YYYY-MM-DD format
  4. Calculate 30 days later with plusDays(30) and print After 30 days: <date>
  5. 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