In order to avoid issues with truncation, a quick fix would be
Code:
intAmount = amount * 100 + 0.5;
intPayment = payment * 100 + 0.5;
The reason is that a float * 100 may end up just a tiny bit below the actual value due to approximate nature of floating point values, e.g 0.11 * 100 = 10.999996 and if you truncate it to int it will become 10.
However, I think normally you should just avoid floating point values where the approximation errors are unacceptable. E.g take the input as a string, parse it to two integers, multiply the first part by 100 and add the second part as needed (avoid errors where user enters 10.5 or 2.345).
Code:
const int HUNDRED = 10000;
const int FIFTY = 5000;
const int TWENTY = 2000;
const int TEN = 1000;
const int FIVE = 500;
const int ONE = 100;
const int QUARTER = 25;
const int DIME = 10;
const int NICKEL = 5;
const int PENNY = 1;
When you continue you'll probably find that this will be better off as an array (perhaps even a map of numeric values and string names).