title: Convertiny Monetary Units
body: <p>I got the dollars to work but now I can`t figure out how to display the quarters, dimes, nickels, and pennies correctly. Technically they show up but my professor wants $1.35 to show up as 1 dollar 1 quarter and 1 dime. But, mine shows up as 1 dollars 5 Quarters 13 Dimes 27 Nickels 135 Pennies. Here is my code:</p>
  
  <pre><code>import java.util.Scanner;
  
  public class ComputeChange {
      public static void main(String[] args) {
          Scanner input = new Scanner(System.in);
          System.out.print("Enter an amount in double, for example 11.56: " );
          double number = input.nextDouble();
          System.out.println("Your amount " + number + " consists of ");
          int remainingamount = (int)(number*100);
          int Quarters = remainingamount/25;
          int Dimes = remainingamount/10;
          int Nickels = remainingamount/5;
          int Pennies = remainingamount;
  
          if (number == 1) {
              System.out.print("1 dollar ");
          }
          else if (number &gt; 1) {
              System.out.print((int)number + " dollars ");
          }
          if (number == 0) {
              System.out.println("");
          }
          System.out.print(Quarters + " Quarters " + Dimes + " Dimes " + Nickels + " Nickels " + Pennies + " Pennies");
      }
  }
  </code></pre>