So im new to programing and need help solving my program because my teacher never taught us about how to solve the issue. it works and compiles as of right now but if you run it. the issue is when i input for ex. .92 cents for the total bill and i input 1 dollar for tendered i need 8 cents but i only get 1 nickel and 2 pennies. she said because it rounds down the last penny.
/**
* Name: Salvatore LoCricchio
* Date January 22, 2013
* Class/Section: CIT160-03
* Problem: Calcualte change
*
*
* Sample Input: Enter bill total for .92 cents
* Enter tendered in dollars 1 dollar
*
* Sample Output: Change = 8 cents
*/
import java.util.Scanner;
public class Locricchiochangmaker
{
public static void main(String args[])
{
float spent, tendered;
int dollars,quarters, dimes, nickels, pennies,change;
Scanner keyboard = new Scanner(System.in);
System.out.println("Bill Total");
spent = keyboard.nextFloat( );
System.out.println("Tendered.");
tendered = keyboard.nextFloat( );
change = (int) ((tendered - spent)*100);
dollars = (change/100);
change = change%100;
quarters = (change/25);
change = change%25;
dimes = (change/10);
change = change%10;
nickels = (change/5);
change = change%5;
pennies = (change);
System.out.println(dollars + " dollars");
System.out.println(quarters + " quarters");
System.out.println(dimes + " dimes");
System.out.println(nickels + " nickels");
System.out.println(pennies + " pennies");
}//end main
}//end class