Returning a value from a double using if/else/if statemets
<pre><code>public static double Num (JTextField field){
    String s1 = field.getText();
    String n = new String ("N");
    String e = new String ("E");
    String w = new String ("W");
    String s = new String ("S"); 
    if (s1.equalsIgnoreCase(n)){
    return 1;}
    else if (s1.equalsIgnoreCase(e)){
    return 1;}
    else if (s.equalsIgnoreCase(s)){
    return -1;}
    if (s1.equalsIgnoreCase(w)){
    return -1;}
}
</code></pre>

<p>Hi i'm a newbie in java programming.
Well i justed wanted to return specific values from a double .Can someone help?
I'm attaching the part of the code.I've selected double because I need to use its value in later sections of the main class code.</p>

<p>After this i'm getting an error saying-"This method must return a result of type double.".And the program is suggesting to add (yet another) return in the end.</p>

<p>Any help anyone? Thanx.</p>
