Yes, your insert function uses only integers. The pennies, nickles, etc are integers, as are the 5, 10, 25. Also, the 100 is an integer. So when you do all your multiplication and addition, you get an integer, and you divide that by another integer (100). This results in "integer division", which discards any fractional part, leaving you with a whole number. Also, you currently return an integer which would also truncate the fractional part. Try the following:
Note the two changes in green, that is all you need to do.Code:float insert (int pennies, int nickels, int dimes, int quarters)//
{
return (pennies + (5*nickels) + (10*dimes) + (25*quarters))/100.0;
}