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 prelo = 3.0; double vora = 2.0; int lesstak = 6; int fe = 3; double pradzus = 1.0; int ri = 9; double caidrhal = 1.0;
...draw the AST and evaluation results for the following expression:
prelo + 3 - vora * 9 - lesstak - 9 + fe % pradzus / 6 % ri / caidrhal
Things to double-check in your solution:
Given the following variables:
int duanhai = 3; int pe = 7; boolean oth = false; double cer = 2.0; double vece = 2.0; boolean triphi = true; double guel = 2.0; double ce = 4.0; boolean nuab = false; boolean lun = false;
...draw the AST and evaluation results for the following expression:
7 > duanhai != (pe == 1) && oth || 5 == cer != ((!(3 == vece)) && triphi != guel < 5 || ce == 5 && nuab == lun)
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 + "10" + 11
Things to double-check in your solution:
Related puzzles: