title: Convert Int to Roman Numeral
body: <p>I am having trouble with my code. Help please. Here is what I have my code so far and I need to use methods. It needs to be able to take an integer 1-3999 and turn that into a roman numeral. Is there an easier way to do this than what I have done? </p>
  
  <pre><code>    public static void main(String[] args) {
      Scanner in = new Scanner (System.in);
      System.out.print("Enter a number between 1 and 3999 (0 to quit): ");
      int input = in.nextInt();
      while (input !=0 )
      {
          if(input &lt; 0 || input &gt; 3999){
          System.out.println("ERROR! NUmber must be between 1 and 3999 (0 to quit): ");
          System.out.print("Enter a number between 1 and 3999 (0 to quit): ");
          input = in.nextInt();
          }
          else if(input &gt; 0){
          String roman = convertNumberToNumeral(input);
          System.out.println("The number " + input + " is the Roman numberal " + roman);
          System.out.print("Enter a number between 1 and 3999 (0 to quit): ");
          input = in.nextInt();
          }
      }
      while (input == 0)
      {
          break;
      }
          System.out.println("Goodbye!");
  }
  
  // Given a Scanner as input, prompts the user to input a number between 1 and 3999.
  // Checks to make sure the number is within range, and provides an error message until
  // the user provides a value within range.  Returns the number input by the user to the
  // calling program.
  private static int promptUserForNumber(Scanner inScanner, int input) {
  }
  
  // Given a number as input, converts the number to a String in Roman numeral format, 
  // following the rules in the writeup for Lab 09.  Returns the String to the calling
  // program.  NOTE:  This method can possibly get long and complex.  Use the 
  // convertDigitToNumeral method below to break this up and make it a bit simpler to code.
  private static String convertNumberToNumeral(int input) {
      String romanOnes = ("");
      String romanTens = ("");
      String romanHundreds = ("");
      String romanThousands = ("");
      int ones = input % 10;
      int tens2 = input / 10;
      if (tens2 &lt; 10)
      {
          tens2 = input / 10;
      }
      else {
          tens2 = tens2 % 100;
      }
      int tens = tens2;
  
      int hundreds2 = input / 100;
      if (hundreds2 &lt; 10)
      {
          hundreds2 = input / 10;
      }
      else {
          hundreds2 = hundreds2 % 1000;
      }
  
      int hundreds = hundreds2;
  
      int thousands2 = input / 1000;
      if (thousands2 &lt; 10)
      {
          thousands2 = input / 10;
      }
      else {
          thousands2 = thousands2 % 10000;
      }
  
      int thousands = input &amp; 10000;
      {
          if (ones == 0)
          {
              romanOnes = ("");
          }
          else if (ones == 1)
          {
              romanOnes = ("I");
          }
          else if (ones == 2)
          {
              romanOnes = ("II");
          }
          else if(ones == 3)
          {
              romanOnes = ("III");
          }
          else if(ones == 4)
          {
              romanOnes = ("IV");
          }
          else if(ones == 5)
          {
              romanOnes = ("V");
          }
          else if(ones == 6)
          {
              romanOnes = ("VI");
          }
          else if(ones == 7)
          {
              romanOnes = ("VII");
          }
          else if(ones == 8)
          {
              romanOnes = ("VIII");
          }
          else if(ones == 9)
          {
              romanOnes = ("IX");
          }
      }
      {
          if (tens == 0)
          {
              romanTens = ("");
          }
          else if (tens == 1)
          {
              romanTens = ("X");
          }
          else if (tens == 2)
          {
              romanTens = ("XX");
          }
          else if(tens == 3)
          {
              romanTens = ("XXX");
          }
          else if(tens == 4)
          {
              romanTens = ("XL");
          }
          else if(tens == 5)
          {
              romanTens = ("L");
          }
          else if(tens == 6)
          {
              romanTens = ("LX");
          }
          else if(tens == 7)
          {
              romanTens = ("LXX");
          }
          else if(tens == 8)
          {
              romanTens = ("LXXX");
          }
          else if(tens == 9)
          {
              romanTens = ("XC");
          }
      }
      {
          if (hundreds == 0)
          {
              romanHundreds = ("");
          }
          else if (hundreds == 1)
          {
              romanHundreds = ("C");
          }
          else if (hundreds == 2)
          {
              romanHundreds = ("CC");
          }
          else if(hundreds == 3)
          {
              romanHundreds = ("CCC");
          }
          else if(hundreds == 4)
          {
              romanHundreds = ("CD");
          }
          else if(hundreds == 5)
          {
              romanHundreds = ("D");
          }
          else if(hundreds == 6)
          {
              romanHundreds = ("DC");
          }
          else if(hundreds == 7)
          {
              romanHundreds = ("DCC");
          }
          else if(hundreds == 8)
          {
              romanHundreds = ("DCCC");
          }
          else if(hundreds == 9)
          {
              romanHundreds = ("CM");
          }
      }
      {
          if (thousands == 0)
          {
              romanThousands = ("");
          }
          else if (thousands == 1)
          {
              romanThousands = ("M");
          }
          else if (thousands == 2)
          {
              romanThousands = ("MM");
          }
          else if(thousands == 3)
          {
              romanThousands = ("MMM");
          }
      }
      String roman = (romanThousands + romanHundreds + romanTens + romanOnes);
      return roman;
  
  }
  
  // Given a digit and the Roman numerals to use for the "one", "five" and "ten" positions,
  // returns the appropriate Roman numeral for that digit.  For example, if the number to
  // convert is 49 we would call convertDigitToNumeral twice.  The first call would be:
  //     convertDigitToNumeral(9, 'I','V','X')
  // and would return a value of "IX".  The second call would be:
  //     convertDigitToNumeral(4, 'X','L','C')
  // and would return a value of "XL".  Putting those togeter we would see that 49 would be the
  // Roman numeral XLIX.
  // Call this method from convertNumberToNumeral above to convert an entire number into a 
  // Roman numeral.
  private static String convertDigitToNumeral(int digit, char one, char five, char ten) {
  
  
  }
  </code></pre>