010-004-001
Method Overloading: Score Aggregation
Easy
Problem Description
method overloading: Score Aggregation
In this problem, you will create a program that reads score data in three different types (int, double, and String), implements overloaded aggregateScore methods applying type-specific conversion logic to each, and displays the results in a unified format to standard output.
Learning Objective: Use overloading to process data in different formats uniformly
Process score data input in different formats (int, double, String) uniformly with overloaded aggregateScore methods. Convert double from 5-point scale to 100-point scale, convert String to number then process.
Input
Integer score (int)
Decimal score (double, on a 5-point scale)
String score (String, treated as 5-point scale if value <= 5)
Output
Score: [converted points] points
Score: [converted points] points
Score: [converted points] points
Examples
Example 1: Basic scores
Input:
5000
4.5
3.5
Output:
Score: 5000 points
Score: 90 points
Score: 70 points
Example 2: Different scores
Input:
2000
4.0
75
Output:
Score: 2000 points
Score: 80 points
Score: 75 points
Test Cases
※ Output examples follow programming industry standards
Normal case
Input:
3000 3.0 4.0
Expected Output:
Score: 3000 points Score: 60 points Score: 80 points
Normal case
Input:
7500 2.5 85
Expected Output:
Score: 7500 points Score: 50 points Score: 85 points
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
