I have some code here that takes a double amount that serves as a dollar amount and outputs the amount of coins it contains. I have been trying to get it to execute "1.69" correctly for a long time, putting in a ridiculous amount of parenthesis to make sure it works; however, the output is never correct. Currently, as it stands below, the output is 6 Quarters, 1 dimes, 1 nickle, and 3 pennies, which is "1.68," and I cannot for the life of me figure out why. Any ideas? Thanks.
ChangeJar2(final double _amount_){
quarters = (int) (_amount_/.25);// Computes # of quarters
dimes = (int) ((_amount_-(quarters*(.25)))/.1);// Computes # of dimes
nickles = (int) ((_amount_-(quarters*(.25))-(dimes*.1))/.05);// Computes # of nickles
pennies = (int) ((_amount_-(quarters*(.25))-(dimes*(.1))-(nickles*(.05)))/.01);// Computes # of pennies
System.out.println(quarters + " " + dimes + " " + nickles + " " + pennies);
}// End of ChangeJar(final double _amount_) Constructor