013-003-006

LocalDate Class: Create Specific Date

Easy

Problem Description

LocalDate class: Create Specific Date

In this problem, you will create a program that reads year, month, and day from standard input, constructs a date object using LocalDate.of(year, month, day), and displays the formatted date string and day-of-week number (obtained via getDayOfWeek().getValue()) to standard output.

Learning Objective: Create specified date with LocalDate.of

Create program creating date object from input year/month/day. Create date with LocalDate.of(year, month, day) and get day of week with getDayOfWeek().

Input

Line 1: Year (integer)
Line 2: Month (integer)
Line 3: Day (integer)

Output

Date: [yyyy-MM-dd]
Day of week: [day number 1-7]
```java

## Examples

### Example 1: Basic date
Input:
```java
2025
10
30
```java
Output:
```java
Date: 2025-10-30
Day of week: 4
```java

### Example 2: New year date
Input:
```java
2024
1
1
```java
Output:
```java
Date: 2024-01-01
Day of week: 1
```java

### Example 3: Year end date (boundary)
Input:
```java
2025
12
31
```java
Output:
```java
Date: 2025-12-31
Day of week: 3

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