I am trying to make a basic program that lets a user input a number, then it will tell them what coins make up this number. This is a project for school and im almsot finished but keep running into an error with my "originalAmount" variable. I have been looking up whats wrong for the past hour with no success so ive decided to ask for help. Here is my code thus far, any help would be great, even a hint!
import java.util.Scanner;
public class coins
{
public static void main(String[] args)
{
int amount, orginalAmount,
quarters, dimes, nickels, pennies;
System.out.println("Enter a whole number from 1 to 99.");
System.out.println("This will tell you what coins make up your number");
Scanner keyboard = new Scanner(System.in);
amount = keyboard.nextInt();
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:");
System.out.println(quarters + " quarters");
System.out.println(dimes + " dimes");
System.out.println(nickels + " nickels and");
System.out.println(pennies + " pennies");
}
}