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 bocrol = 5.0; double biel = 5.0; int preniong = 9; double perte = 4.0;
...draw the AST and evaluation results for the following expression:
bocrol / 3 + 8 - biel / preniong - 1 + perte
Things to double-check in your solution:
Given the following variables:
double pof = 1.0; int schoa = 9; boolean elim = true; int ne = 2; int pucs = 7; boolean om = true;
...draw the AST and evaluation results for the following expression:
pof >= schoa && elim != (ne == pucs) && 8 > 1 == om != 7 > 6
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
Things to double-check in your solution:
Related puzzles: