Help needed to turn a recursive method into iterative

Hi there! I'm in need of a bit of help, I'm going crazy with some Java practice I have to do.

I need to turn this recursive method (cal):

public class Recursivo {

private int valores[] = {12, 13, 25, 34, 56, 75, 16, 78, 11, 65, 89};

public int cal (int a, int b)

{

int i = (a+b)/2;

if (a<=b) {

return (valores[i]%2) + cal(a, i-1) + cal(i+1, b);

}

else {

return 0;

}

}

}

into a non recursive (iterative) method that does the same thing.

Anyone can spare some time to help me out?

Thanks!