008-004-011
Argument Order and Types
Medium
Problem Description
Argument Order and Types
In this problem, you will create a program that defines a formatDate(int year, int month, int day) method, reads year, month, and day from standard input, formats the date with / delimiters, and displays the result to standard output.
Learning Objective: Understand the importance of argument order and types
Overview
Create a method with multiple arguments of the same type to learn the importance of order.
Specifications
- Define
formatDate(int year, int month, int day)method - Read year, month, and day as integers from standard input, one per line
- Call
formatDatewith the read values and output the formatted date
Input Format
year
month
day
Output Format
year/month/day
Example
Input:
2024
12
25
Output:
2024/12/25
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