001-006-007
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 and integer point balance using Scanner, then displays formatted card information with separator lines 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
================================
Examples
Example 1: Taro Tanaka, 1500pt
Input:
Taro Tanaka
1500
Output:
================================
Point Card Info
================================
Member: Taro Tanaka
Balance: 1500pt
================================
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