Aa

Text size

?

Map / Arrays

🧮 Arrays

An array holds a fixed number of values of one type, numbered from 0. Walk it with for or for-each, find the biggest, search it, and lay out a grid with a 2D array. An array variable is a reference, so two names can share one array.

  • int[]
  • new int[n]
  • {1, 2, 3}
  • .length
  • a[i]
  • for-each
  • int[][]

🛠 You will build: A gradebook and a game board

0 / 11 done

  1. 🔮 Predict 1. Slots numbered from 0
  2. 👣 Trace 2. An array goes into a method
  3. 🔮 Predict 3. for-each hands you a copy
  4. 🧩 Order 4. The hottest day
  5. ✏️ Fill in 5. Class average
  6. 🐞 Debug 6. Steps past the end
  7. 🐞 Debug 7. A copy that is not a copy
  8. 🔮 Predict 8. Rows and columns
  9. 🔧 Modify 9. Search from the end
  10. ⌨️ Write 10. A gradebook
  11. ⌨️ Write 11. A game board

Unit check

Earlier activities again, with new inputs and edge cases. They also come back on the map as review the next day.

  1. 🔮 Predict Check 1. Check: other starting values
  2. ⌨️ Write Check 2. Check: where is the smallest?