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 lasm = 5; double gagre = 2.0; int marceu = 1; int nafra = 5; double ses = 5.0; int hisherm = 8;
...draw the AST and evaluation results for the following expression:
6 / 4 * lasm / (gagre * 8 * marceu / nafra * 4 / 7) + ses * hisherm - 2
Things to double-check in your solution:
Given the following variables:
boolean trecsdo = true; boolean e = true; double mec = 5.0; double buine = 3.0; int prial = 4; boolean hapeic = false; double strer = 3.0; double es = 4.0; int craspus = 3; double lal = 2.0; int rhengban = 6; double rar = 5.0; double vouh = 2.0; double seff = 1.0; double in = 4.0;
...draw the AST and evaluation results for the following expression:
(trecsdo == e && mec < buine == 3 <= prial != hapeic == (3 == strer)) && es > 3 == (craspus != lal) || rhengban == rar == vouh < 3 || seff < in
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: