004-008-001
Multidimensional Array: Weekly Points Table
Easy
Problem Description
multidimensional array: Weekly Points Table
In this problem, you will create a program that reads daily point data for multiple stores using a 2D array, calculates each day's subtotal and the grand total across all days, and displays a formatted weekly points table to standard output.
Learning Objective: Manage numeric data with 2D array and implement aggregation processing
Manage weekly point card earning records. Create 2D array to record point earnings by combination of day and store (3 stores).
Input
Line 1: Number of days n (1-3)
Following lines: Points for n days (3 stores per day: Store A Store B Store C)
Output
=== Weekly Points ===
Day 1: A:[pt]pt B:[pt]pt C:[pt]pt = [total]pt
Day 2: A:[pt]pt B:[pt]pt C:[pt]pt = [total]pt
...
━━━━━━━━━━━━━━━━
Total: [grand total]pt ([n] days)
```java
## Examples
### Example 1: 2 Days of Points
Input:
```java
2
10 20 30
15 25 35
```java
Output:
```java
=== Weekly Points ===
Day 1: A:10pt B:20pt C:30pt = 60pt
Day 2: A:15pt B:25pt C:35pt = 75pt
━━━━━━━━━━━━━━━━
Total: 135pt (2 days)
Test Cases
※ Output examples follow programming industry standards
Normal case
Input:
2 100 200 300 50 60 70
Expected Output:
=== Weekly Points === Day 1: A:100pt B:200pt C:300pt = 600pt Day 2: A:50pt B:60pt C:70pt = 180pt ━━━━━━━━━━━━━━━━ Total: 780pt (2 days)
Normal case
Input:
1 50 40 30
Expected Output:
=== Weekly Points === Day 1: A:50pt B:40pt C:30pt = 120pt ━━━━━━━━━━━━━━━━ Total: 120pt (1 days)
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
