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 sas = 1; double mec = 2.0; double ha = 4.0; int screlist = 1; int ris = 9; double besptrent = 3.0;
...draw the AST and evaluation results for the following expression:
sas / mec + ha + screlist / ris / besptrent - 6
Things to double-check in your solution:
Given the following variables:
int peu = 1; double heoruc = 2.0; boolean teazeel = false; double on = 2.0; double frirhesm = 3.0; int curspont = 4; double nui = 4.0; double re = 5.0; boolean gacec = true;
...draw the AST and evaluation results for the following expression:
peu < heoruc == teazeel != !(on > 0) != (frirhesm == curspont) == nui > re || gacec
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: