Given String[] c I am trying to make it so that if "X" is present in the array 10 is added to int xvalue. Otherwise something else happens. This is what I have tried so far I am not sure what exactly is going wrong.
if (i==c.length - 1 && !c[i].contains("X") )
sum += 0 ;
else if (c[i].contains("X"))
xvalue+=10;
else
sum += (Integer.parseInt(c[i])*pos) ;
Also the "X" is only ever present in the last value of the array. Thanks for the help.