For each of the Java expressions below:
Be sure that your tree accurately reflects how Java would evaluate the expression.
Given the following variables:
int gantsod = 8; double i = 4.0; int e = 7; double phlun = 5.0; double mamho = 2.0;
...draw the AST and evaluation results for the following expression:
gantsod + (4 % i % 6 % e - phlun / mamho % 2)
Things to double-check in your solution:
Given the following variables:
boolean sousm = true; int pe = 5; int aspheal = 8; double hormun = 4.0; double o = 5.0; double co = 1.0; double in = 5.0; boolean rodis = false;
...draw the AST and evaluation results for the following expression:
sousm != pe >= 1 || aspheal < 3 && 9 <= 7 || (hormun != o || co <= in && rodis)
Things to double-check in your solution:
Draw the AST and evaluation results for the following expression:
0 + 1 + 2 + 3 + 4 + 5 + "6" + 7 + 8
Things to double-check in your solution:
Related puzzles: