Exam 8: Arrays

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

In Java, boolean array elements automatically are assigned the value ____.

(Multiple Choice)
5.0/5
(70)

int[] multsOfTen = {10, 20, 30, 40, 50, 60}; The above code creates an array named multsOfTen . Describe how array sizes are determined when using an initialization list and how memory is assigned.

(Essay)
4.9/5
(81)

While you can provide any legal identifier you want for an array, conventional rules are typically followed. List and describe the naming conventions for naming arrays.

(Essay)
4.9/5
(77)

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.7/5
(92)

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)
4.8/5
(79)

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)
4.7/5
(82)
Showing 61 - 66 of 66
close modal

Filters

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