Trying to create a simple calculator on java. No errors show up in the code. But it still doesn't work at all. am I missing anything?

```
import java.util.Scanner;

public class JavaApplication15 {

    public static void main(String[] args) {
    Scanner in = new Scanner(System.in);

      System.out.println("This is a calculator. Enter a letter followed by a number to calculate it.");
       System.out.println(" S = sine \n C = Cosine \n T = Tangent \n R = Square Root \n N = natural Log \n X = exit the program");
        String num = in.nextLine();

        String sValue = num.substring(2);
        String char_a = num.substring(0);

       int choice = Integer.parseInt(char_a);
       double dValue = Double.parseDouble(sValue);

       while (choice != 'x'){
        switch(choice){

            case 's':
                Math.sin(dValue);
                System.out.println("The sine of your number is " + dValue);
                break;
            case'c':    
                 Math.cos(dValue);
                 System.out.println("The Cosine of your number is " + dValue);
                  break;
            case't':   
                 Math.tan(dValue);
                 System.out.println("The Tangent of your number is " + dValue);
                  break;
            case'r': 
                 Math.sqrt(dValue);
                 System.out.println("The square root of your number is " + dValue);
                  break;
            case'n':    
                 Math.log(dValue);
                 System.out.println("The Log of your number is " + dValue);
                  break;
            case'x':
                break;

        }
       }

    }

}

```