RoD is a float, it will be treated as a floating point number.
(0.5 * 10) = 5.0, then ( 5.0 - 50 ) => -45.0, -45.0 / 15 => -3 when it gets assigned to an int, you loose all the floating point precision, it gets truncated, that's why you get -3 instead of -3.0.
RoD * 10 => 1.55 * 10 = 15.5
After the multiplication of RoD and 10, if you multiply the result with 3 you would get : 15.5 * 3 = 46.5
If it wouldn't be treated as a floating point number, you would get 45 instead of 46.5. Cout 'level',and you will see it holds the value 46, which proves you had a floating point number until it got assigned to level(int), but it got truncated.
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"