The main problem is how you are storing the initial retrieved value. You are calling
GetFloat() and storing the result in
owed, a variable of type int. GetFloat() returns a floating point number, which will be implicitly cast as an int when you try to store it in owed. In the process, the decimal point portion will be truncated. That means that you could try to store 4.85 all day and it will always store as integer 4.
You should store the value returned from GetFloat() in a float var, not an int. Later, multiply by 100 and round and then store it in an int, as you are trying to do.
As a side note, the last few lines, while they will work, aren't terribly clean. You create a new float to modify what should be another float and store the result, and on the next line, cast a float to an int and store the int back in a float. It would make more sense to round the float and store it back in the same float, but on the next line to cast the float as an int and store it in a new, int var. Or, a cleaner thing would be to do it all in one line:
int change = roundf(dollars*100);
If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)