Can Some One fix this code ??(java Split)
<pre><code>import java.util.HashMap;
import java.util.Stack;

    public class Interpret

    {

    public static double check(String[] k) 

    {
        Stack&lt;String&gt; ops = new Stack&lt;String&gt;();
        Stack&lt;Double&gt; vals = new Stack&lt;Double&gt;();
        HashMap&lt;String, Double&gt; hMap = new HashMap&lt;String, Double&gt;();

        for(int i =0;i&lt;k.length;i++)
        {
            if(k[i].equals("("));
            else if (k[i].equals("+"))    ops.push(k[i]);
            else if (k[i].equals("-"))    ops.push(k[i]);
            else if (k[i].equals("*"))    ops.push(k[i]);
            else if (k[i].equals("/"))    ops.push(k[i]);
            else if (k[i].equals("sqrt")) ops.push(k[i]);


            else if (k[i].equals(")"))
            {
                String op = ops.pop();
                double v = vals.pop();
                if      (op.equals("+"))    v = vals.pop() + v;
                else if (op.equals("-"))    v = vals.pop() - v;
                else if (op.equals("*"))    v = vals.pop() * v;
                else if (op.equals("/"))    v = vals.pop() / v;
                else if (op.equals("sqrt")) v = Math.sqrt(v);
                vals.push(v);
            }
            else vals.push(Double.parseDouble(k[i]));           
        }


        while(!ops.empty())
        {
            String op = ops.pop();
            double v = vals.pop();
            if      (op.equals("+"))    v = vals.pop() + v;
            else if (op.equals("-"))    v = vals.pop() - v;
            else if (op.equals("*"))    v = vals.pop() * v;
            else if (op.equals("/"))    v = vals.pop() / v;
            else if (op.equals("sqrt")) v = Math.sqrt(v);
            vals.push(v);
        }         
        return vals.pop();        
    }


    public static void main(String[] args)
    {
        String[] a = StdIn.readAll().split("\\s+");
        StdOut.println(check(a));
    }
    }
</code></pre>

<p>I tried to several thing but i cannot figure out whats wrong with my code everytime i run it goes out of bound or doesn't show an output</p>

<p>The Input File Contain the following
( 10 + 10 ) * ( 10 + 50 )</p>
