Exam 8: Arrays

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

public static int[] sampleArray() { int studentScores = {72, 91, 83}; ____ } Using the above code, write the statement that will return the array name.

(Short Answer)
4.9/5
(85)

Providing values for all the elements in an array is called ____ the array.

(Multiple Choice)
4.9/5
(80)

Write the statement to declare an array variable named studentScores with type double. Write a second statement to create an array of 10 objects.

(Essay)
4.9/5
(66)

What does an array's name represent and what value does it hold when declared?

(Essay)
4.8/5
(71)

When you declare int[] someNums = new int[10];, each element of someNums has a value of ____________________ because someNums is a numeric array.

(Short Answer)
4.9/5
(93)

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
(84)

When populating an array with an initialization list, you do not need to use the new keyword or provide an array size. Explain why this is the case.

(Essay)
4.9/5
(83)

Using just one statement, declare and create an array that will reserve memory locations for 10 scores values that are type double.

(Essay)
4.8/5
(83)

String[] countyNames = {"Clark", "Delaware", "Madison"}; What will be the value of countyNames[0].length(), countyNames[1].length(), and countyNames[2].length()?

(Essay)
4.8/5
(74)

Which of the following statements correctly declares and creates an array to hold five double scores values?

(Multiple Choice)
4.7/5
(81)

Primitive type variables are always passed by ____.

(Multiple Choice)
4.8/5
(66)

A(n) ____ loop allows you to cycle through an array without specifying the starting and ending points for the loop control variable.

(Multiple Choice)
4.9/5
(86)

double[] studentScores = new double[3]; studentScores[0] = 93; studentScores[1] = 77; studentScores[2] = 85; Write a println statement to display the last element of the studentScores array.

(Short Answer)
4.9/5
(87)

How would you use a method that belongs to an object that is part of the array? Use an example and demonstrate with Java code.

(Essay)
4.7/5
(80)

A(n) ____________________ is a named list of data items that all have the same type.

(Short Answer)
4.9/5
(79)

int[] sixNumbers = {1, 2, 3, 4}; The above code creates an array named sixNumbers. Describe how array sizes are determined when using an initialization list and how memory is assigned.

(Essay)
4.9/5
(84)

Match each term with the correct statement below. -Declared in the same way you declare any simple variable

(Multiple Choice)
4.9/5
(89)

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.

(True/False)
4.9/5
(74)

The following statement declares an array: int[] increaseValues = new int[5] final int PLUSTWO = 2; Create a loop that will add 2 to every array element. Use a symbolic constant named PLUSTWO and use the length field in the loop that will contain the number of elements in the array.

(Essay)
4.8/5
(83)

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
(70)
Showing 21 - 40 of 74
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)