It works for me, but there should be an else statement, this catches input that doesn't satisfy any of the other conditions, like a default statement in a switch.
You can discover this yourself by turning on the warning levels when compiling. I used cpp.sh (the gear icon top right of the code) turn on all 3 warning levels. Warnings are your friend, they tell you what is wrong with the code.
Also, you might want to add an equals sign on line 30, 35 and line 55.
If the user inputs 100, 101 or 59 then it will return 100, 101 and 59 respectively.
Also how can I make it return the float properly, i.e. 4.0 points, not 4 points?
Exactly how JLBorges did it. To clarify though, he included <iomanip> which allows you to use the fixed and setprecision() command. You can put whatever number you want into the parentheses following setprecision and it will output that number in decimal places.
i.e. setprecision(2) = 3.14, setprecision(3) = 3.141