title: Convert Letters & Numbers in a Phone Number to all Numbers (Java)
body: <pre><code>import java.util.Scanner;
  
  import javax.swing.JOptionPane;
  
  
  public class PhonePadTranslator {
  
  private static Scanner input;
  
  public static void main(String[] args) {
  
      input = new Scanner(System.in);
      System.out.println("Enter The Phone Number (With Letters) ");
      String initial_phone_number = input.nextLine();
      initial_phone_number = initial_phone_number.toUpperCase();
      int phone_number_final = 0;
  
      System.out.printf("The phone number for %s is %s", initial_phone_number, phone_number_final);
  
  }//end of main
  
  public static int full_number(String initial_phone_number) 
  {
      int which_character = 0;
      int phone_number_final = 0;
      char ch = (Character) null;
  
      for (which_character = 0; which_character &lt; initial_phone_number.length(); which_character++) 
      {
          if (Character.isLetter(ch)) 
          {
              switch(ch)
              {
          case 'A' : case 'B' : case 'C' : phone_number_final = 2; break;
          case 'D' : case 'E' : case 'F' : phone_number_final = 3; break;
          case 'G' : case 'H' : case 'I' : phone_number_final = 4; break;
          case 'J' : case 'K' : case 'L' : phone_number_final = 5; break;
          case 'M' : case 'N' : case 'O' : phone_number_final = 6; break;
          case 'P' : case 'Q' : case 'R' : case 'S' : phone_number_final = 7; break;
          case 'T' : case 'U' : case 'V' : phone_number_final = 8; break;
          case 'W' : case 'X' : case 'Y' : case 'Z' : phone_number_final =9; break;
              }
              return (char)phone_number_final;
          }
          if (Character.isDigit(ch))
          {
              return (char)phone_number_final;
          }
  
          else {
              return (char)phone_number_final;
          }
  
      } //end of for
      return ch;
  }//end of full_number
  }//end of class
  </code></pre>
  
  <p>I just thought I'd copy/paste the whole thing... but whenever I run the code, it keeps outputting <strong><em>The phone number for 1800FLOWERS is 0</em></strong>. Now I'm sure there's some other things that are wrong, but my main concern is why it keeps giving me a <code>0</code>? I feel like it's because I initialised it to that and for some reason I'm never changing the value. Please help, my professor takes forever to respond to my emails :( </p>