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 ori = 4.0; int phou = 7; double mo = 2.0; int humo = 5; int oon = 2; int psanre = 9;
...draw the AST and evaluation results for the following expression:
ori + phou + mo - 2 / 9 - humo + (oon - psanre)
Things to double-check in your solution:
Given the following variables:
double hul = 1.0; double pao = 2.0; int cechdir = 1; double sepheu = 5.0; boolean depos = false; double peunchos = 1.0; double rass = 4.0;
...draw the AST and evaluation results for the following expression:
(hul < pao && !(cechdir != 5) || !(sepheu > 8) || depos && 6 >= 0 || 1 <= peunchos || rass <= 9)
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: