Page 946 - AP Computer Science A, 7th edition
P. 946

8. (A) The statement is syntactically correct, but as written it will not find the mean of the integers. The bug is therefore an intent or logic error. To execute as intended, the statement needs parentheses:
double average = (n1 + n2 + n3 + n4) / (double) 4;

































































































   944   945   946   947   948