im writing a Coin program that tells the user to input a integer between 1 and 99..and reads back how many quarters, dimes, nickels, and pennies back. this is what i have.
import java.util.Scanner;
public class Main
{
public static void main( String[] args )
{
Scanner input = new Scanner( System.in );
int number1;
int quarters;
int nickels;
int dimes;
int pennies;
System.out.print( "Enter a number between 1 and 99:");
number1 = input.nextInt();
quarters = number1 / 25;
dimes = number1 / 10;
nickels = number1 /5;
pennies = number1 /1;
System.out.printf( "Number of quarters %d\n", quarters);
System.out.printf( "Number of dimes %d\n", dimes);
System.out.printf("Number of nickels %d\n", nickels);
System.out.printf("Number of pennies %d\n",pennies);
}
}
can anybody help???