title: Need help writing an int to roman numeral converter using only if, if else, and switch statements
body: <p>Here is the code: </p>
  
  <pre><code>public String ToRoman(int number)
  {
  
      if ((number &lt; 1 || (number &gt; 3999)))
  
          if (number &gt;= 1000) return "M" + ToRoman(number - 1000);
  
          if (number &gt;= 900) return "CM" + ToRoman(number - 900); 
  
          if (number &gt;= 500) return "D" + ToRoman(number - 500);
  
          if (number &gt;= 400) return "CD" + ToRoman(number - 400);
  
          if (number &gt;= 100) return "C" + ToRoman(number - 100);            
  
          if (number &gt;= 90) return "XC" + ToRoman(number - 90);
  
          if (number &gt;= 50) return "L" + ToRoman(number - 50);
  
          if (number &gt;= 40) return "XL" + ToRoman(number - 40);
  
          if (number &gt;= 10) return "X" + ToRoman(number - 10);
  
          if (number &gt;= 9) return "IX" + ToRoman(number - 9);
  
          if (number &gt;= 5) return "V" + ToRoman(number - 5);
  
          if (number &gt;= 4) return "IV" + ToRoman(number - 4);
  
          if (number &gt;= 1) return "I" + ToRoman(number - 1);
  
      Scanner myKeyboard = new Scanner (System.in);
      System.out.println("Enter the integer: ");
      number = myKeyboard.nextInt();
  
      myKeyboard.close();
  
  
      }
  }
  </code></pre>
  
  <p>The problem im having is that i get an error saying "The method must return a result type string".</p>