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 slephta = 8; double ca = 5.0; double jemos = 4.0; int ne = 1; int lonoc = 9;
...draw the AST and evaluation results for the following expression:
slephta / ca / (3 / jemos) * ne * lonoc + 0
Things to double-check in your solution:
Given the following variables:
double ohscrot = 5.0; double missrin = 1.0; double lungshast = 3.0; boolean odrad = true; boolean blung = false;
...draw the AST and evaluation results for the following expression:
4 != 1 == ohscrot > 6 != 8 >= missrin && 8 >= lungshast != odrad || blung
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: