educative.io

Educative

Challenge 2: Letter Grade to GPA - Learn Java from Scratch

So i’m doing the challenge, I’ve written out my little bit of code and tested it.

So the four values point values that are no a multiple of 0.5, i.e 3.7 (A-), 3.3 (B+), 2.8 (B-), 1.8 (C-) are returning weird values. I’ve checked against the solution and can’t see any errors.

For example, A- which has an expected outut of 3.7 is giving an actual output of 3.700000047683716
this happens for each one.

Help?

Hello @Thesmokingfox_Is

Can you kindly please provide the code you have written so that I can execute it on my end and verify the possible causes of values it is returning back.

Regards