GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Karteikarten

2D Arrays and Enhanced For Loop

nhunsdale02 Programming I Masters Englisch 20 Karten

Karten in diesem Stapel (20)

  1. 1Enhanced For Statement Does it use a loop counter?No
  2. 2Enhanced For Statement Because it doesn't use a loop counter, this avoids the possibility of _____ _____ the arraystepping outside
  3. 3Enhanced For Statement What is the syntax?for(parameter {name} : array){
    statement(s);
    }
  4. 4Enhanced For Statement Create an enhanced for loop to calculate the total of array "wage" :for(int number : wageArray){
    total+= number;
    }
  5. 5Enhanced For Statement Best used for _____arrays
  6. 6Enhanced For Statement Can it be used to modify elements?No
  7. 7Nested for What is it?One for loop inside another
  8. 8Enhanced For Statement How many total loops if the outer loop runs 5 times and the inner loop runs 10 times? How do you calculate this?50
    outer loop runs x inner loop runs
  9. 9Multidimensional Arrays What are they often used to represent?tables consisting of rows and columns
  10. 10Multidimensional Arrays When identifying a table element, what is the first of the 2 indices identify?the row
  11. 11Multidimensional Arrays When identifying a table element, what is the second of the 2 indices identify?column
  12. 12Multidimensional Arrays Arrays that require 2 indices are called _____ _____ arrays2 dimensional
  13. 13Multidimensional Arrays Create a 2D array with 3 rows and 4 columns :int[][] myArray = new int[3][4];
  14. 14Multidimensional Arrays Populate row 1 and column 3 with value "64":myArray[0][2] = 64;
  15. 15Multidimensional Arrays Say I wanted to set the termination value to refer to the row length of an array...what would the code be?counter
  16. 16Multidimensional Arrays Say I wanted to set the termination value to refer to the column length of an array...what would the code be?counter
  17. 17Bubble Sorting Arrays How does it work?Compares adjacent elements of the array.
    The first and second elements are swapped if out of order, and then the 2nd and 3rd etc.
    After the first pass through, it does it again
  18. 18Bubble Sorting Arrays When does it know how to swap?When there are no more swaps to be made
  19. 19Bubble Sorting Arrays How does the bubble sort keep track of the occurring swaps?A flag
  20. 20Sorting Arrays Instead of using bubble sort, you can use :Arrays.sort(myArray);

Informationen

Beschreibung
Masters Programming I Karteikarten am 2D Arrays and Enhanced For Loop, erstellt von nhunsdale02 am 05/06/2014.
Erstellt von
nhunsdale02
Aufrufe
31
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck