在Android中解析冲突多个if else和逻辑操作文本

时间:2014-05-15 10:58:53

标签: java android split hashtable

简单但我无法理解部分。

我有String logictext1 =" IF(QN_723_0> = 25 AND QN_723_0< = 30)那么QN_723_1 = 75 END IF&#34 ;;

让我们假设QN_723_0 is AgeQN_723_1 is weight

你看到我的字符串上面,也很明显。

if I gave input age 28 and weight exactly 75 then return true output otherwise false..

if I gave input age 45 and weight exactly 75 then gives false output.

if I gave input age 45 and weight exactly 74 then gives true output.

我该怎么办?我的主要问题是如何解析上面的if else,然后解析java中的字符串。

enter image description here

1 个答案:

答案 0 :(得分:1)

public boolean GetValue() {
    int QN_723_0_age = 0, QN_723_1_weight = 0;
    if ((QN_723_0_age >= 25 && QN_723_0_age <= 30)) {
                QN_723_1_weight == 75;
        return true;
    } else {
        return false;
    }
}

我希望它对你有用....

if i gave input age 28 and weight exactly 75 then return true output 

if i gave input age 45 and weight exactly 75 then gives false output.

if i gave input age 45 and weight exactly 74 then gives false output.