002-001-010
Scanner Class: Profile Input
Easy
Problem Description
Scanner Class: Profile Input
Learning Objective: Understand how to receive input from keyboard using Scanner class
Create a simple profile input program. Use the Scanner class to input name and age, then display the profile.
Input
Line 1: Name (string)
Line 2: Age (integer)
Output
=== Profile ===
Name: [name]
Age: [age]
===============
Examples
Example 1
Input:
Taro
25
Output:
=== Profile ===
Name: Taro
Age: 25
===============
Example 2
Input:
Hanako
18
Output:
=== Profile ===
Name: Hanako
Age: 18
===============
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
