Indicate whether the following are true or false: _______ all elements in an arr
ID: 3833343 • Letter: I
Question
Indicate whether the following are true or false: _______ all elements in an array are of the same type _________ array subscripts must be integers ______ arrays cannot contain string elements _________ parallel arrays must have equal lengths (wts and names are parallel) _________ two-dimensional arrays must have the same number or rows and columns _______ two parallel arrays can be replaced by a two-dimensional array ________ a method can change the data in an array passed to it as a parameter What data is stored in the array by the following code: int powers[3][2]; for (int i = 0; iExplanation / Answer
All elements in an array are of same type.
TRUE. Array is a collection of homogenous elements.
Array subscripts must be integers.
TRUE. Array subscripts starts with 0, and will go till n-1, where n is the size of the array.
Arrays cannot contain string elements.
FALSE. String arrays are allowed to have string elements.
Parallel arrays must have equal lengths.
TRUE. Usually, thats why they are called parallel arrays.
Two-dimensional arrays must have the same number of rows and columns
FALSE. Number of rows could be different to that of columns.
Two parallel arrays can be replaced by a two-dimensional array.
FALSE. Two parallel arrays need not be of same type. And therefore, can't combine together.
A method can change the data in an array passed to it as a parameter.
TRUE. Arrays are internally passed by reference.