this is my code at the moment:
public class Evaluation {
String str1 = "1 + 2 + 3";
public static double evaluation(String str1){
if (str1 == null || str1 == ""){
return 0;
}
return 0;
}
}
What I want to be able to do it use str1 and evaluate whatever is put in there.
eg. "1 * 3 * -2" should return -6 etc. and it must be in the form of
Number, Operator, Number, Operator, Number
How do I accomplish this?