title: Divide by Zero Simple Program
body: <pre><code> public static void main(String [] args) {
  
   Scanner userInput = new Scanner(System.in);
  
   int myCents = 0;
   int myDollars = 0;
   int myQuarters = 0;
   int myDimes = 0;
   int myNickels = 0;
   int myPennies = 0;
  
   System.out.printf("Please enter the amount of cents below: \n");
   myCents = userInput.nextInt();
  
   myDollars = myCents/100;
   myQuarters = myCents % myDollars;
   myDimes = myCents % myQuarters;
   myNickels = myCents % myDimes;
   myPennies = myCents % myNickels;
  
   System.out.printf(myCents + " is equal to %4d", myDollars);
   System.out.printf(" dollar(s), " + myQuarters);
   System.out.printf(" quarter(s), " + myDimes);
   System.out.printf(" dime(s), " + myNickels);
   System.out.printf(" nickel(s) and " + myPennies + " pennies. \n");
  }
  }
  Error:  java.lang.ArithmeticException: / by zero
  </code></pre>
  
  <p>The error seems to keep popping up. We have not learned if statements for Java as of yet. It is supposed to be a simple program.</p>