002-001-008
Scanner Class Basics: Name Survey
Easy
Problem Description
Scanner Class Basics: Name Survey
Learning Objective: Use Scanner class to input strings from keyboard
In a name survey program, input and display a name. Scanner class is a tool for receiving data from the keyboard.
Input
Line 1: Name (string)
Output
================================
Name Survey
================================
Thank you for your input!
Your name: [name]
================================
Examples
Example 1: Taro Tanaka
Input:
Taro Tanaka
Output:
================================
Name Survey
================================
Thank you for your input!
Your name: Taro Tanaka
================================
Your Solution
Current Mode:● My Code
99
1
2
3
4
5
6
7
8
9
10
›
⌄
⌄
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 10 free executions remaining
