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 previn = 1.0; int pirce = 3; double linhor = 4.0; double slidprel = 4.0; int fronot = 1; double as = 2.0; int asswer = 1; int buip = 5;
...draw the AST and evaluation results for the following expression:
previn + 6 - pirce * linhor + slidprel * 1 * fronot / as % 2 * 6 % asswer + buip
Things to double-check in your solution:
Given the following variables:
double ple = 5.0; boolean slerdmoi = false; boolean viober = false; boolean bagaet = false; int grigie = 8; double pi = 5.0; boolean al = false; int troorec = 4; int tilasm = 3;
...draw the AST and evaluation results for the following expression:
5 < 9 && !(2 >= 5) != ple > 7 != slerdmoi || viober && !bagaet == (4 != grigie) || 3 >= pi && al != (5 != troorec) || 4 == tilasm
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: