a. Math.abs(14/5);
b.Math.pow(14,5);
c. double chocAmount = 14.0/5.0;
//chose between these 3 options
Answer: C would be the only option that fits your needs because you donât want an absolute value for your number of chocolates. It has to be accurate, and you donât need exponents either. You just want to find out how to split the chocolate amount. So, this would be your answer.
String s = âThis is the beginningâ;
String t = s.substring(5);
int n = t.indexOf(âtheâ);
Answer: The value of n will be 3. The question is asking for the value of n, which is the indexOf âtheâ in String t, which is essentially just a substring of string s. Determine t first, which is the substring that begins at the index 5 of s. Start at 0 and count the spaces as different characters. Index 5 is the letter i, at the beginning of the word is. Since string t is a substring of s, the sentence for this substring would be âis the beginningâ. the index of âtheâ is 3 because it begins at index 3.
\