002-003-007

Numeric Input: Age Input Form

Easy

Problem Description

Numeric Input: Age Input Form

Learning Objective: Input integers using nextInt() method

In an age input form, input name and age to display them.
Using nextInt(), you can receive integers from keyboard.

Input

Line 1: Name (string)
Line 2: Age (integer)

Output

================================
       Profile
================================
Name: [name]
Age: [age] years old
================================

Test Cases

※ Output examples follow programming industry standards

Input:
Taro Tanaka
25
Expected Output:
================================
    Profile
================================
Name: Taro Tanaka
Age: 25 years old
================================
Input:
Hanako Sato
30
Expected Output:
================================
    Profile
================================
Name: Hanako Sato
Age: 30 years old
================================
Input:
Ichiro Yamada
18
Expected Output:
================================
    Profile
================================
Name: Ichiro Yamada
Age: 18 years old
================================
❌ Some tests failed
❌ エラー発生

Your Solution

Current Mode: My Code
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Write your code here

sc.close();
}
}
0 B / 5 MB

You have 6 free executions remaining