Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Evaluate each of the following expressions and write the final value for each su

ID: 3921000 • Letter: E

Question

Evaluate each of the following expressions and write the final value for each such that each value clearly indicates the type of value. Always use the initial values of the variables as shown.

int j = 25;
int k = 34;
String s = "John Smith";

a) ____________ k / j
b) ____________s.charAt( 6 )
c) ____________s.substring(3, 8)
d) ____________s.length();
e) ____________"David".equals("david")
f) ____________k > j && k < 34
g) ____________k % j
h) ____________j + k / 4
i) ____________2 + 4 + s
j) ____________ s + 2 + 4

For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac).

Explanation / Answer

Answer:

a) ____________ k / j --------- Answer: 1
b) ____________s.charAt( 6 ) --------- Answer: m
c) ____________s.substring(3, 8)   --------- Answer: n Smi
d) ____________s.length();   --------- Answer: 10
e) ____________"David".equals("david")   --------- Answer: false
f) ____________k > j && k < 34   --------- Answer: false
g) ____________k % j   --------- Answer: 9
h) ____________j + k / 4   --------- Answer: 33
i) ____________2 + 4 + s    --------- Answer: 6John Smith
j) ____________ s + 2 + 4   --------- Answer: John Smith24

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote