import java.util.Scanner;
public class Change {
private static Scanner input;
public static void main(String[] args) {
input = new Scanner (System.in);
double change; //User input value
double hund, twend, tend, fived, oned, quarters , dimes, nickels;
double afthund, afttwend, afttend, aftfived, aftoned, aftquarters, aftdimes, aftnickels;
double hundreds, twenties, tens, fives, ones, twentyfivecents, tencents, fivecents;
System.out.println("How much money would you like me to give you change for?");
change = input.nextDouble();
hund = change;
afthund = hund % 100.00;
hund = hund - afthund;
hundreds = hund / 100;
System.out.println("lna1= " + hund);
System.out.println("lna2= " + afthund);
System.out.println();
twend = afthund;
afttwend = twend % 20.00;
twend = twend - afttwend;
twenties = twend / 20;
System.out.println("lnb1= " + twend);
System.out.println("lnb2= " + afttwend);
System.out.println();
tend = afttwend; //Divide aftwend by 10.00 (tend)
afttend = tend % 10.00; //then get amount left over (afttend)
tend = tend - afttend;
tens = tend / 10;
System.out.println("lnc1= " + tend);
System.out.println("lnc2= " + afttend);
System.out.println();
fived = afttend;
aftfived = fived % 5.00;
fived = fived - aftfived;
fives = fived / 5;
System.out.println("lnd1= " + fived);
System.out.println("lnd2= " + aftfived);
System.out.println();
oned = aftfived;
aftoned = oned % 1.00;
oned = oned - aftoned;
ones = oned / 1.00;
System.out.println("lne1= " + oned);
System.out.println("lne2= " + aftoned);
System.out.println();
quarters = aftoned;
aftquarters = quarters % .25;
quarters = quarters - aftquarters;
twentyfivecents = quarters / .25;
System.out.println("lnf1= " + quarters);
System.out.println("lnf2= " + aftquarters);
System.out.println();
dimes = aftquarters;
aftdimes = dimes % .10;
dimes = dimes - aftdimes;
tencents = dimes / .10;
System.out.println("lng1= " + dimes);
System.out.println("lng2= " + aftdimes);
System.out.println();
nickels = aftdimes;
aftnickels = nickels % .05;
nickels = nickels - aftnickels;
fivecents = nickels / .05;
System.out.println("lnh1= " + nickels);
System.out.println("lnh2= " + aftnickels);
System.out.println();
System.out.print("Hundreds: " + (int)hundreds); //Print hundreds
System.out.println();
System.out.print("Twenties: " + (int)twenties); //Print twenties
System.out.println();
System.out.print("Tens: " + (int)tens); //Print tens
System.out.println();
System.out.print("Fives: " + (int)fives); //Print fives
System.out.println();
System.out.print("Ones: " + (int)ones); //Print ones
System.out.println();
System.out.print("Quarters: " + (int)twentyfivecents); //Print quarters
System.out.println();
System.out.print("Dimes: " + (int)tencents); //Print dimes
System.out.println();
System.out.print("Nickels: " + (int)fivecents); //Print nickels
System.out.println();
System.out.print("Pennies: " + (int)aftnickels); //Print pennies
System.out.println();
}
}