004-008-002
Multidimensional Array: Weekly Menu Table
Easy
Problem Description
multidimensional array: Weekly Menu Table
In this problem, you will create a program that manages a weekly menu table using a 2D string array (indexed by day and meal time) and displays the formatted schedule to standard output.
Learning Objective: Create 2D string array and store data
Manage weekly menu table. Create 2D array to record menus by combination of day and meal time (breakfast, lunch, dinner).
Input
Line 1: Number of days n (1-3)
Following lines: Menus for n days (3 meals per day: breakfast lunch dinner)
Output
=== Weekly Menu ===
Day 1: Breakfast[breakfast] Lunch[lunch] Dinner[dinner]
Day 2: Breakfast[breakfast] Lunch[lunch] Dinner[dinner]
...
━━━━━━━━━━━━━━━━
Total: [n] days, [n×3] meals
```java
## Examples
### Example 1: 2 Days of Menus
Input:
```java
2
bread salad curry
rice ramen sushi
```java
Output:
```java
=== Weekly Menu ===
Day 1: Breakfastbread Lunchsalad Dinnercurry
Day 2: Breakfastrice Lunchramen Dinnersushi
━━━━━━━━━━━━━━━━
Total: 2 days, 6 meals
Test Cases
※ Output examples follow programming industry standards
Normal case
Input:
2 Bread Salad Curry Rice Ramen Sushi
Expected Output:
=== Weekly Menu === Day 1: BreakfastBread LunchSalad DinnerCurry Day 2: BreakfastRice LunchRamen DinnerSushi ━━━━━━━━━━━━━━━━ Total: 2 days, 6 meals
Normal case
Input:
1 Toast Soup Steak
Expected Output:
=== Weekly Menu === Day 1: BreakfastToast LunchSoup DinnerSteak ━━━━━━━━━━━━━━━━ Total: 1 days, 3 meals
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
