title: Multiple variables for a switch statement in C#
body: <p>I am new here but have more or less stalked through the forums from time to time.</p>
  
  <p>I am working in c# and this is a homework assignment but I am attempting to use a switch statement to convert 7 ref character variables from a letter to a corresponding number. The question I have is how (if its even possible) can I use multiple variables for one switch statement. The cases will always be the same and I would rather not have 27 cases per switch statement for 7 statements. I would honestly prefer to do a set of if statements but that is out of the question. </p>
  
  <p>Any assistance would be greatly appreciated. Thank you.</p>
  
  <p>Here is my c# code for this particular portion:</p>
  
  <pre><code>static int ToDigit(ref char ch1, ref char ch2, ref char ch3, ref char ch4, ref char ch5, ref char ch6, ref char ch7)
  {
  
          ProcessInput(ref ch1, ref ch2, ref ch3, ref ch4, ref ch5, ref ch6, ref ch7);
  
          ch1 = char.ToUpper(ch1);
          ch2 = char.ToUpper(ch2);
          ch3 = char.ToUpper(ch3);
          ch4 = char.ToUpper(ch4);
          ch5 = char.ToUpper(ch5);
          ch6 = char.ToUpper(ch6);
          ch7 = char.ToUpper(ch7);
  
          switch (ch1)
          {
              case 'A':
                  Console.Write(2);
                  break;
              case 'B':
                  Console.Write(2);
                  break;
              case 'C':
                  Console.Write(2);
                  break;
              case 'D':
                  Console.Write(3);
                  break;
              case 'E':
                  Console.Write(3);
                  break;
              case 'F':
                  Console.Write(3);
                  break;
              case 'G':
                  Console.Write(3);
                  break;
              case 'H':
                  Console.Write(3);
                  break;
              case 'I':
                  Console.Write(3);
                  break;
              case 'J':
                  Console.Write(3);
                  break;
              case 'K':
                  Console.Write(3);
                  break;
              case 'L':
                  Console.Write(3);
                  break;
              case 'M':
                  Console.Write(3);
                  break;
              case 'N':
                  Console.Write(3);
                  break;
              case 'O':
                  Console.Write(3);
                  break;
              case 'P':
                  Console.Write(3);
                  break;
              case 'Q':
                  Console.Write(3);
                  break;
              case 'R':
                  Console.Write(3);
                  break;
              case 'S':
                  Console.Write(3);
                  break;
              case 'T':
                  Console.Write(3);
                  break;
              case 'U':
                  Console.Write(3);
                  break;
              case 'V':
                  Console.Write(3);
                  break;
              case 'W':
                  Console.Write(3);
                  break;
              case 'X':
                  Console.Write(3);
                  break;
              case 'Y':
                  Console.Write(3);
                  break;
              case 'Z':
                  Console.Write(3);
                  break;
              default:
                  Console.Write(-1);
                  return -1;
  </code></pre>