001-006-002
Variable Declaration Placement: Point Card Balance Check
Easy
Problem Description
variable declaration Placement: Point Card Balance Check
In this problem, you will create a program that reads a member name (string) and point balance (integer) from standard input and displays formatted point card information to standard output.
Learning Objective: Declare variables in appropriate locations to improve code readability
In a point card system, input member name and point balance, then display them. Declaring variables near where they are used makes programs easier to understand.
Input
Line 1: Member name (string)
Line 2: Point balance (integer)
Output
================================
Point Card Info
================================
Member: [name]
Balance: [points]pt
================================
```java
## Examples
### Example 1: Taro Tanaka, 1500pt
Input:
```java
Taro Tanaka
1500
```java
Output:
```java
================================
Point Card Info
================================
Member: Taro Tanaka
Balance: 1500pt
================================
Test Cases
※ Output examples follow programming industry standards
Normal case
Input:
Yuki Kimura 750
Expected Output:
================================ Point Card Info ================================ Member: Yuki Kimura Balance: 750pt ================================
Normal case
Input:
Hanako Sato 3200
Expected Output:
================================ Point Card Info ================================ Member: Hanako Sato Balance: 3200pt ================================
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
