002-001-010

Scanner Class: Profile Input

Easy

Problem Description

Scanner class: Profile Input

In this problem, you will create a program that reads a name (string) and age (integer) from standard input on separate lines using the Scanner class, then displays the profile in the specified format to standard output.

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?

Sign Up