StateFarmInsCodingCompetition / 2023-StateFarm-CodingCompetition

Welcome to the 2023 State Farm Coding Competition. If you have questions during the coding competition, please contact codingcompetition@statefarm.com or you can submit an issue through GitHub.
https://codingcompetition.statefarm.com
Apache License 2.0
6 stars 48 forks source link

Java - Accuracy issues for Estimate Cost #9

Open unclebinary1001 opened 1 year ago

unclebinary1001 commented 1 year ago

the getTotalClaimCostForDisaster method is of float data type so accuracy does not match expected value in TestSet2 so test4_getTotalClaimCostForDisaster fails for getTotalClaimCostForDisaster(56).

image

I tried changing estimate_cost data type in Claim.java and the return types of the methods that depend on it from Float to Double. This fixes the test and it works expected

J1411 commented 1 year ago

Thanks for bringing this up. We're double checking and looking into it. Please continue on and we'll get back to you shortly

J1411 commented 1 year ago

@unclebinary1001 You are right, looks like a float/Float doesn't have enough precision and we get the wrong expected value back. Thanks for catching this. I'll add it to our change log and push up a fix. Though it is late in the competition, hopefully this will help others working in Java too.

unclebinary1001 commented 1 year ago

Sounds good.

proesslet commented 1 year ago

I believe something similar may be happening in Test Set 3 for Test 11. Screenshot 2023-10-14 at 11 10 15 PM