001-002-004
Variable Assignment: Shopping Receipt
Easy
Problem Description
Variable Assignment: Shopping Receipt
Learning Objective: Understand how to assign values to variables
Create a program that inputs a product name and price, then outputs them in receipt format.
Input
Line 1: Product name (string)
Line 2: Price (integer)
Output
Item: [product name]
Price: [price] yen
```java
## Example
Input:
```java
Apple
150
```java
Output:
```java
Item: Apple
Price: 150 yen
Test Cases
※ Output examples follow programming industry standards
Input:
Apple 150
Expected Output:
Item: Apple Price: 150 yen
Input:
Milk 200
Expected Output:
Item: Milk Price: 200 yen
Input:
Bread 0
Expected Output:
Item: Bread Price: 0 yen
❌ Some tests failed
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 6 free executions remaining
