002-002-002
String Input: Message Card Creation
Easy
Problem Description
String Input: Message Card Creation
In this problem, you will create a program that reads two strings (sender name and recipient name) in sequence using Scanner's nextLine() method and displays a formatted message card to standard output.
Learning Objective: Input multiple strings using nextLine() method
In a message card creation program, input sender and recipient names to display the card.
Practice inputting multiple strings in sequence.
Input
Line 1: Sender name (string)
Line 2: Recipient name (string)
Output
================================
Message Card
================================
From: [sender]
To: [recipient]
Thank you!
================================
Test Cases
※ Output examples follow programming industry standards
Normal case
Input:
Taro Tanaka Hanako Sato
Expected Output:
================================ Message Card ================================ From: Taro Tanaka To: Hanako Sato Thank you! ================================
Normal case
Input:
Alice Bob
Expected Output:
================================ Message Card ================================ From: Alice To: Bob Thank you! ================================
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
