Anyways, I'm having trouble with this Cash Register code. I've been working on it for a day now, and it still won't work. Any ideas?
import java.util.*;
import java.io.*;
public class Cash
{
public static void main(String[] args)
{
Scanner console = new Scanner(System.in);
int amountDue,amountPaid;
double pennies,dollars,nickels,dimes,quarters;
System.out.print("The amount due: ");
amountDue = console.nextInt();
System.out.print("The amount paid: ");
amountPaid = console.nextInt();
System.out.print("You change is: ");
pennies = amountPaid-amountDue+50;
dollars=pennies/100;
pennies=pennies%100;
quarters = pennies/25;;
pennies = pennies%25;
dimes = pennies/10;
pennies = pennies%10;
nickels = pennies/5;
pennies = pennies%5;
pennies = pennies/1;
pennies = pennies%1;
System.out.println("The change due:");
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");
}
}