title: numbers to roman numeral using switch case
body: <p>so I have a homework where I have to make a program to change numbers to roman numeral. I want to use switch cases but I don't want to write out every single number from 1-3999. I was told that we can do it by changing the cases to different numbers places separately but I do not understand how that works this is what i have for the ones place and tens place but how would I put them together?</p>
  
  <pre><code>public class Number {
  public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      System.out.print("Please enter a number between 1 and 3999: ");
      int number= scan.nextInt();
      String numberString;
  
      switch (number%10) 
      {
          case 1:  numberString = "I";
                   break;
          case 2:  numberString = "II";
                   break;
          case 3:  numberString = "III";
                   break;
          case 4:  numberString = "IV";
                   break;
          case 5:  numberString = "V";
                   break;
          case 6:  numberString = "VI";
                   break;
          case 7:  numberString = "VII";
                   break;
          case 8:  numberString = "VIII";
                   break;
          case 9:  numberString = "IX";
                   break;
          default: numberString = "Invalid nummber";
                   break;
      }
  
      switch ((number%100)/10) 
      {
          case 1:  numberString = "X";
                   break;
          case 2:  numberString = "XX";
                   break;
          case 3:  numberString = "XXX";
                   break;
          case 4:  numberString = "XL";
                   break;
          case 5:  numberString = "L";
                   break;
          case 6:  numberString = "LX";
                   break;
          case 7:  numberString = "LXX";
                   break;
          case 8:  numberString = "LXXX";
                   break;
          case 9:  numberString = "XC";
                   break;
          default: numberString = "Invalid nummber";
                   break;
      }
      System.out.println(numberString);
    }
  }
  </code></pre>