package changemaker;
import java.util.Scanner;
public class ChangeMaker
{
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);
int amount, originalAmount, quarters, dimes, nickels, pennies;
System.out.println("Enter the amount of change");
amount = scanner.nextInt();
originalAmount = amount;
amount = amount.replace('X','');
quarters = amount / 25;
amount = amount % 25;
dimes = amount / 10;
amount = amount %10;
nickels = amount / 5;
amount = amount %5;
pennies = amount;
System.out.println(originalAmount + " cents in coins can be given as:\n" + quarters + " quarters\n" + dimes + " dimes\n" + nickels + " nickels\n" + pennies + " pennies");
}
}
I think i figured it out. Thanks!