004-003-001
Switch Statement: Menu Selection
Easy
Problem Description
Switch Statement: Menu Selection
Learning Objective: Implement selection processing based on discrete values using switch statement
Display dish name and price from restaurant menu number. Implement selection from multiple choices using switch statement.
Input
Line 1: Menu number (integer 1-5)
Output
[dish name]: [price] yen
```java
## Menu Correspondence
- 1: Curry: 800 yen
- 2: Ramen: 700 yen
- 3: Pasta: 900 yen
- 4: Rice bowl: 750 yen
- 5: Set meal: 1000 yen
## Examples
### Example 1: Select Menu 1
Input:
```java
1
```java
Output:
```java
Curry: 800 yen
```java
### Example 2: Select Menu 3
Input:
```java
3
```java
Output:
```java
Pasta: 900 yen
```java
### Example 3: Select Menu 5 (Boundary)
Input:
```java
5
```java
Output:
```java
Set meal: 1000 yen
Test Cases
※ Output examples follow programming industry standards
Input:
1
Expected Output:
Curry: 800 ¥
Input:
3
Expected Output:
Pasta: 900 ¥
Input:
5
Expected Output:
Set meal: 1000 ¥
❌ 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 9 free executions remaining
