For each of the Java expressions below:
Be sure that your tree accurately reflects how Java would evaluate the expression.
Given the following variables:
double mebru = 2.0; double usspel = 3.0; double a = 1.0; int wa = 5; int co = 4; double o = 3.0; int gossthal = 7; int scros = 7;
...draw the AST and evaluation results for the following expression:
mebru - 9 - usspel * a - wa + co / o + gossthal + scros
Things to double-check in your solution:
Given the following variables:
double hirtre = 2.0; boolean spinsest = true; int tre = 2; boolean cer = false; boolean scosproch = true; boolean pras = false; int hiad = 6; int ro = 6;
...draw the AST and evaluation results for the following expression:
hirtre == 1 != spinsest && tre >= 5 || cer == !scosproch && 1 <= 4 || pras || hiad == ro
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" + 9
Things to double-check in your solution:
Related puzzles: