Exam 8: Arrays
Exam 1: Creating Your First Java Classes76 Questions
Exam 2: Using Data81 Questions
Exam 3: Using Methods, Classes and Objects79 Questions
Exam 4: More Object Concepts84 Questions
Exam 5: Making Decisions80 Questions
Exam 6: Looping77 Questions
Exam 7: Characters, Strings and the Stringbuilder82 Questions
Exam 8: Arrays77 Questions
Exam 9: Advanced Array Concepts80 Questions
Exam 10: Introduction to Inheritance78 Questions
Exam 11: Advanced Inheritance Concepts78 Questions
Exam 12: Exception Handling79 Questions
Exam 13: File Input and Output78 Questions
Exam 14: Introduction to Swing Components79 Questions
Exam 15: Using Javafx and Scene Builder65 Questions
Select questions type
Match each term with the correct statement below.
Premises:
Using a subscript that is too small (that is, negative) or too large for an array,
Responses:
reference types
enhanced for loop
int
Correct Answer:
Premises:
Responses:
Free
(Matching)
4.8/5
(80)
Correct Answer:
When any ____ type ( boolean , char , byte , short , int , long , float , or double ) is passed to a method, the value is passed.
Free
(Multiple Choice)
5.0/5
(91)
Correct Answer:
D
When using parallel arrays, if one array has many possible matches, it is most efficient to place the less common items first so that they are matched right away.
Free
(True/False)
4.8/5
(95)
Correct Answer:
False
Languages such as Visual Basic, BASIC, and COBOL use ____ to refer to individual array elements.
(Multiple Choice)
4.8/5
(100)
Match each term with the correct statement below.
Premises:
Allows you to cycle through an array without specifying the starting and ending elements
Responses:
reference type
subscript
parallel arrays
Correct Answer:
Premises:
Responses:
(Matching)
4.9/5
(81)
When using an array with all elements used, why would a programmer use a loop control variable from 0 to one less than the size of the array? Give an example.
(Essay)
5.0/5
(75)
Individual array elements are ____ by value when a copy of the value is made and used within the receiving method.
(Multiple Choice)
4.9/5
(74)
A(n) ____ is an integer contained within square brackets that indicates one of an array's variables.
(Multiple Choice)
4.8/5
(89)
Match each term with the correct statement below.
Premises:
An enhanced for loop
Responses:
elements
passed by value
int
Correct Answer:
Premises:
Responses:
(Matching)
4.8/5
(85)
Write the statement to create an array named studentScores that will store five integer value student scores. Initialize the array using an initialization list with the values 70, 85, 92, 67, and 76.
(Essay)
4.9/5
(74)
public class CostArray
{
public static void main(String[] args)
{
double[] costs = new double[3];
costs[0] = 5.00;
costs[1] = 7.00;
costs[2] = 9.00;
System.out.println(costs[3]);
}
}
Once the above code is compiled and executed, an error message is generated. Explain the error message that will result and explain the reason for the error.
(Essay)
5.0/5
(82)
Match each term with the correct statement below.
Premises:
Two or more arrays in which the values in corresponding elements are related
Responses:
enhanced for loop
range match
foreach loop
Correct Answer:
Premises:
Responses:
(Matching)
5.0/5
(77)
When you declare or access an array, you can use any expression to represent the size, as long as the expression is a(n) ____.
(Multiple Choice)
4.8/5
(78)
Comparing a variable to a list of values in an array is a process called ____ an array.
(Multiple Choice)
4.8/5
(73)
A ____ array is one with the same number of elements as another, and for which the values in corresponding elements are related.
(Multiple Choice)
4.8/5
(73)
You can declare an array variable by placing curly brackets after the array name.
(True/False)
4.7/5
(84)
Providing values for all the elements in an array is called ____ the array.
(Multiple Choice)
4.8/5
(82)
When any primitive type variable is passed to a method, the _____ is passed.
(Multiple Choice)
4.9/5
(87)
Why is the length field a good option when writing a loop that manipulates an array? What programming error is common when attempting to use length as an array method?
(Essay)
4.8/5
(78)
Showing 1 - 20 of 77
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)