Question: float cent = 0.01F; float dollar = 0.0F; for( int i = 0; i != 100; ++i ) dollar += cent; System.out.println(dollar == 1.00F); Enter
float cent = 0.01F; float dollar = 0.0F; for( int i = 0; i != 100; ++i ) dollar += cent; System.out.println(dollar == 1.00F);
Enter and run this code and verify that the output is the word "false" (meaning that the value of the variable dollar is not 1.00). Which step (or steps) in the program snippet is the cause of this output to be the result of the computation? (Please do not explain how the println method evaluates its argument to get the "false" outputjust explain why the result is as it is.) (Java).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
