Method Overloading: Score Aggregation
Problem Description
method overloading: Score Aggregation
In this problem, you will create a program that processes score data passed as three different types (int, double, and String) using overloaded aggregateScore methods and displays the results 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
Line 1: Integer score (int type)
Line 2: Decimal score (double type, 5-point scale if value <= 5)
Line 3: String score (String type)
Output
Score: [converted points] points
Score: [converted points] points
Score: [converted points] points
Examples
Example 1
Input:
5000
4.5
3.5
Output:
Score: 5000 points
Score: 90 points
Score: 70 points
Example 2
Input:
2000
4.0
75
Output:
Score: 2000 points
Score: 80 points
Score: 75 points
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up