V Evaluate each of the following according to the JAVA precedence rules.
In each case, show what value is stored in the variable on the left-hand side.
SHOW YOUR WORK SO IT IS CLEAR WHICH OPERATION IS DONE FIRST, THEN SECOND, ETC., UNTIL THE FINAL ANSWER.
DON’T SKIP STEPS. Start from these initial values each time.
int b = 4, p = 7, r = 2, v = 8;
double x;
(i) x = (double) p / r + 3 * b - 5; x =
(ii) x = v % b + 10 - p / r * r; x =
(iii) Write the JAVA statement to perform the following:
Assign x the value of p multiplied by r+6, all divided by the square root of the sum of b and p
If you have any doubts, please give me comment...
Given data:
i)
int b = 4, p = 7, r = 2, v = 8;
x = 7 / 2 + 3 * 4 - 5
x = 7 / 2 + 12 - 5
x = 3.5 + 12 - 5
x = 15.5 - 5
x = 10.5
ii)
x = v % b + 10 - p / r * r;
x = 8 % 4 + 10 - 7 / 2 * 2;
x = 0 + 10 - 7 / 2 * 2;
x = 10 - 3 * 2;
x = 10 - 6;
x = 4
iii)
x = (p * (r+6)) / Math.sqrt(b+p);
V Evaluate each of the following according to the JAVA precedence rules. In each case, show...