title: code for error message if decimal point is used
body: <p>as part of the program iam writing there is to be an option for the user to enter a number to obtain the facotrial of. So far i have this: </p>
  
  <pre><code>number = Integer.parseInt(JOptionPane.showInputDialog("\nPlease enter the number you wish to obtain the factorial for"));
      JOptionPane.showMessageDialog(null, "You entered the number: " + number);
  
  
      count = (number - 1);
  
      if(number &gt; 1)
      {
  
      do
  
      {
  
      factorial = number * count;
      JOptionPane.showMessageDialog(null, number + " * " + count + " = " + factorial);
      count--;
      number = factorial;
  
      }
  
      while(count &gt; 0);
  
      JOptionPane.showMessageDialog(null, number + " * " + count + " = " + factorial);
  
      JOptionPane.showMessageDialog(null, "The facorial of " + number + " is " + factorial);
  
      }
  
      else if (number == 0)
  
      {
  
      JOptionPane.showMessageDialog(null, "Factorial of 0 is 1");
  
      }
  
      else if (number == 1)
  
      {
  
      JOptionPane.showMessageDialog(null, "Factorial of 1 is 1");
  
      }
  
      else if (number &lt; 0)
  
      {
  
      JOptionPane.showMessageDialog(null, "Please enter a number equal to or greater than 0");
  </code></pre>
  
  <p>This works fine but the brief is to also include an error message prompting the user ro enter a whole number when a decmimal number has been used and also if a letter is inputted. I am struggling to write code to achieve this.</p>
  
  <p>Thanks in advance</p>
  
  <p>Ryan</p>