1. For each statement, circle the response that best completes it. For the first nine statements, consider this Java method and the array shown to its right. array public static int linkSun (inta, int startloc, int sunlimit) ( lat sun 0, 1 startloc; } while (1>0 sun sun a[i]; + 1 = a[i]; return sun; sun sunlinit) { (ii) The call linkSum (junk, a. 1 b. 4 c. 5 (i) The expression linkSun (junk, 3, 12) evaluates to a 13 b. 22 c. 10 d. 1 (iii) The call linkSum (junk, ArrayIndexOutOfBoundsException b. 2 a actual parameter c. local variable startLoc 012 Junk 10141711131-1101 211 d. 6 a. boolean expression c. assignment statement ,20) results in an infinite loop. e. none of above ,15) results in an being thrown. d. 6 a 1 c. 5 e. none of above (iv) In the method above (applied to any array), we can be sure that at the moment that the loop terminates. a a[1] < 0 c. 1 < 0 kk sum b. 1 > startLoc 11 sun > sunlimit d. 1 <0 11 sum >= sunlimit e. none of the above (v) In the method above, each of int and static is a(n) a reserved word b. variable c. expression (vi) In the method above, sun is a(n) a actual parameter c. local variable (vii) In the method above, startLoc is a(a) b. formal parameter e. none of above b. formal parameter d. instance variable 4567 d. instance variable (viii) In the method above, 1 a[1] is a(n) b. arithmetic expression d. method call d. parameter will be true
1. For each statement, circle the response that best completes it. For the first nine statements, consider this Java method and the array shown to its right. array public static int linkSun (inta, int startloc, int sunlimit) ( lat sun 0, 1 startloc; } while (1>0 sun sun a[i]; + 1 = a[i]; return sun; sun sunlinit) { (ii) The call linkSum (junk, a. 1 b. 4 c. 5 (i) The expression linkSun (junk, 3, 12) evaluates to a 13 b. 22 c. 10 d. 1 (iii) The call linkSum (junk, ArrayIndexOutOfBoundsException b. 2 a actual parameter c. local variable startLoc 012 Junk 10141711131-1101 211 d. 6 a. boolean expression c. assignment statement ,20) results in an infinite loop. e. none of above ,15) results in an being thrown. d. 6 a 1 c. 5 e. none of above (iv) In the method above (applied to any array), we can be sure that at the moment that the loop terminates. a a[1] < 0 c. 1 < 0 kk sum b. 1 > startLoc 11 sun > sunlimit d. 1 <0 11 sum >= sunlimit e. none of the above (v) In the method above, each of int and static is a(n) a reserved word b. variable c. expression (vi) In the method above, sun is a(n) a actual parameter c. local variable (vii) In the method above, startLoc is a(a) b. formal parameter e. none of above b. formal parameter d. instance variable 4567 d. instance variable (viii) In the method above, 1 a[1] is a(n) b. arithmetic expression d. method call d. parameter will be true
Chapter8: Arrays
Section: Chapter Questions
Problem 20RQ
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT