CS302 EXAM 1 Questions and Answers with Verified Solutions | Latest
2026 Update
Q: given: String[] list = {"a", "b", "c"} ; i = 0; what does list.length vs.
list[i].length() return?
Answer:
Array.length is a property of arrays that returns the number of elements in an array so
list.length returns 3 String.length() is a method of strings that returns the number of
characters in a string, and because 'list' is a string type array, list[i].length() returns
the number of characters at index i in array list so returns 1 ("a" = 1 char)
Q: return type of Math.pow(x, y)
Answer:
double
, CS302 EXAM 1 Questions and Answers with Verified Solutions | Latest
2026 Update
Q: algorithms
Answer:
a step-by-step set of operations to be performed
procedure for solving a problem in terms of the actions to be executed and the order
in which
those actions are to be executed.
sequence of steps taken to solve a problem
Q: abstraction
Answer:
a technique for managing complexity
2026 Update
Q: given: String[] list = {"a", "b", "c"} ; i = 0; what does list.length vs.
list[i].length() return?
Answer:
Array.length is a property of arrays that returns the number of elements in an array so
list.length returns 3 String.length() is a method of strings that returns the number of
characters in a string, and because 'list' is a string type array, list[i].length() returns
the number of characters at index i in array list so returns 1 ("a" = 1 char)
Q: return type of Math.pow(x, y)
Answer:
double
, CS302 EXAM 1 Questions and Answers with Verified Solutions | Latest
2026 Update
Q: algorithms
Answer:
a step-by-step set of operations to be performed
procedure for solving a problem in terms of the actions to be executed and the order
in which
those actions are to be executed.
sequence of steps taken to solve a problem
Q: abstraction
Answer:
a technique for managing complexity