004-003-006
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.
Test Cases
※ Output examples follow programming industry standards
Input:
1
Expected Output:
Curry: 800 yen
Input:
3
Expected Output:
Pasta: 900 yen
Input:
5
Expected Output:
Set meal: 1000 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
