Close
Close full mode
logoMakeCode AP CSP

Student Tasks/Solutions

Activity

Task 1: Arrays Task 1

Task 1 Challenge: Arrays Task 1 Challenge

Task 2: Arrays Task 2

Task 2 Challenge: Arrays Task 2 Challenge

Reflection/Homework

  1. What is the difference between creating an array of numbers and storing multiple values as individual variables (as in, value1 = 1, value2 = 2, value3 ...)?

    • An array is a collection of values of the same data type that can be stored in a single variable. It makes accessing, organizing, modifying and assigning a group of values easier. Dealing with individual variable values can be cumbersome if there are a lot of values, and error-prone if the values are also somehow related to each other.
  2. What can an array do that storing different variables by themselves cannot?

    • You can access and modify a collection of values in one operation.
    • ou can access array values in a sequential order.
    • Arrays save computer memory - space can be dynamically allocated depending on the size of the array. Variables must be declared ahead of time and take up space in memory.
  3. How does the length of an array relate to the position of the final element?

    • The length of an array is 1 more than the index position of the final element.
πŸ“˜ Unit 5 - AAP Part 2 β€” Previous
Arrays Work
Next β€” πŸ“˜ Unit 5 - AAP Part 2
Day 15