| Summary: | Location Score conversion calculation problem | ||
|---|---|---|---|
| Product: | 2021 CS3343 Hall Admission System | Reporter: | amble3232 |
| Component: | Scoring and Weighting Record Section | Assignee: | Azim <mohamazim2> |
| Status: | RESOLVED FIXED | ||
| Severity: | major | CC: | chpang22-c |
| Priority: | High | ||
| Version: | unspecified | ||
| Hardware: | PC | ||
| OS: | Windows | ||
|
Description
amble3232
2021-12-04 15:25:11 HKT
The input of “Hung Shui Kiu” into the method convertScore() in Area_Location class should have returned “8.0”. Therefore it is a bug. I expect the bug is within method convertScore() in Area_Location class. I will pass it to the developer to solve this bug. I just checked the method Area_Location and the return has a problem. It should have rounding in the calculation not just “return locationScore[i]/100*10;”.
To solve the number rounding problem, the return statement was trained.
Solution:
===============
public static int convertScore(String rawData) {
for (int i = 0; i < locationList.length; i++) {
if(rawData.equals(locationList[i])) {
return (int) Math.round(locationScore[i]/100.0*10.0);
}
}
}
|