Dollars and Cents (JAVA)
<p>I need help with the calucluations for this java project i'm working on. The assignment asks me write a program that will spell out the number of dollars &amp; cents based on a user numeric input. So, basically, the person enters a number like 815. and the program should output  "8 dollars and 15 cents"). </p>

<p>This is the code I have so far.</p>

<p><strong>UPDATED</strong> again</p>

<pre><code>public class DollarCents
{

    public static void main(String args [])
    {
        // Declaration of variables.
       int dollars;
       int cents;
       String inputNumberString;
       int inputNumber;
       int calculatedAnswer;

       // Get interactive user input
       inputNumberString = JOptionPane.showInputDialog("Enter Cents: ");

       // Convert String to int
       inputNumber = Integer.parseInt(inputNumberString);

       // Calculate the number
       dollars = inputNumber / 100;
       cents = inputNumber % 100;

       // Output the result
       System.out.println ("The Cents entered equal: $"+ dollars +"."+ cents);
    }
}
</code></pre>
