import java.util.Scanner;
public class AdvancedDispenser
{
public static void main(String args)
{
Scanner console = new Scanner (
System.in);
System.out.print("Enter price of item (in cents): ");
int price = console.nextInt();
int change = 100 - price;
int quarter = 25, dime = 10, nickel = 5, penny = 1;
int numberofquarters = change / quarter;
int leftover = change - numberofquarters * quarter;
int numberofdimes = leftover / dime;
int leftover2 = leftover - numberofdimes * dime;
int numberofnickels = leftover2 / nickel;
int leftover3 = leftover2 - numberofnickels * nickel;
int numberofpennies = leftover3 / penny;
System.out.println(" ");
String conclusion = "You bought an item for " + price;
String conclusion2 = " cents and gave me a dollar,";
String conclusion3 = "so your change is:";
System.out.print(conclusion);
System.out.println(conclusion2);
System.out.println(conclusion3);
System.out.println(" ");
System.out.println(numberofquarters + " quarter(s),");
System.out.println(numberofdimes + " dime(s),");
System.out.println(numberofnickels + " nickel(s),");
System.out.print(numberofpennies + " penny(ies)");
} //End of main
} //End of AdvancedDispenser
It is wrong to spam in mineplex, but Java doesn't give a fuck.