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 bretresh = 7; double apkin = 3.0; int tia = 8; double miamsi = 5.0; double spul = 3.0; int a = 1; double o = 3.0;
...draw the AST and evaluation results for the following expression:
bretresh / 5 / 6 % apkin + tia % miamsi % spul % 1 * 4 + a % 8 % o
Things to double-check in your solution:
Given the following variables:
double hetios = 3.0; double cluss = 5.0; boolean paftis = false; int stil = 9; int le = 2; double etam = 1.0; int ce = 9; boolean preschu = false; boolean ocmu = true; double eoustdear = 2.0; boolean at = true; double cripfle = 3.0;
...draw the AST and evaluation results for the following expression:
5 < hetios == 4 < cluss == paftis == !(stil < le) && etam >= ce && preschu == ocmu && !(1 == eoustdear) == 1 <= 9 != at && cripfle == 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 + 8) + 9 + "10" + "11" + 12
Things to double-check in your solution:
Related puzzles: