004-007-001
Array Length: Point Records Count
Easy
Problem Description
array Length: Point Records Count
Learning Objective: Get data count using array's .length property
In this problem, you will create a program that stores multiple point earning records in an array, retrieves the count using the .length property, and displays a formatted list along with a summary to standard output.
Manage point card earning records. Store this month's point earning history in an array and display record count using .length property.
Input
Line 1: Number of records n (1-5)
Following lines: Points for each transaction (n items, 1-100)
Output
=== Point Records ===
Total Records: [n] items
━━━━━━━━━━━━━━━━
[1] [points1]pt
[2] [points2]pt
...
━━━━━━━━━━━━━━━━
Summary: [n] records, total [total]pt
Examples
Example 1: 3 Point Records
Input:
3
50
30
20
Output:
=== Point Records ===
Total Records: 3 items
━━━━━━━━━━━━━━━━
[1] 50pt
[2] 30pt
[3] 20pt
━━━━━━━━━━━━━━━━
Summary: 3 records, total 100pt
Test Cases
※ Output examples follow programming industry standards
Normal case
Input:
5 15 25 35 45 55
Expected Output:
=== Point Records === Total Records: 5 items ━━━━━━━━━━━━━━━━ [1] 15pt [2] 25pt [3] 35pt [4] 45pt [5] 55pt ━━━━━━━━━━━━━━━━ Summary: 5 records, total 175pt
Normal case
Input:
2 40 60
Expected Output:
=== Point Records === Total Records: 2 items ━━━━━━━━━━━━━━━━ [1] 40pt [2] 60pt ━━━━━━━━━━━━━━━━ Summary: 2 records, total 100pt
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
