i have to write a program that has to subtract the purchase price from 100 and then determine the number of qtr,dms,nkls,pns.. when i run it my results are in decimal am not sure how to change it..any advice thanks alot..
import java.util.Scanner;
public class Subtract
{
public static void main(String [] args)
{
double purchase,change,quarters,dimes,nickels,pennies;
Scanner keyboard=new Scanner(System.in);
System.out.println("Enter purchase amount under 1.00:");
purchase=keyboard.nextDouble();
change=100-purchase;
quarters=change/25;
dimes=change/10;
nickels=change/5;
pennies=change/1;
System.out.println("Enter purchase amount: " + purchase);
System.out.println("The change is: " + change);
System.out.println("The number of quarters is: " + quarters);
System.out.println("The number of dimes is: " + dimes);
System.out.println("The number of nickels is: " + nickels);
System.out.println("The number of pennies is: " + pennies);
}
}