Close
Close full mode
logoMakeCode AP CSP

Student Tasks/Solutions

Activity

Task 1a: Princess Dialog Task 1a

Task 1a Challenge: Princess Dialog Task 1a Challenge

Task 1b: Princess Dialog Task 1b

Extension Challenge 1: Array Challenge 1

Extension Challenge 2: Array Challenge 2

Reflection/Homework

  1. Why do we use the length of array instead of just β€œhard-coding” the value of the length (for example 4)?

    • The length may change as the program is running.
  2. What is the difference between a For Index and a For Value loop?

    • For Index uses a number variable to keep track of the index position in an Array. For Value automatically loops through an Array returning the value in order.
  3. Can you think of any situations where you might prefer the For Index loop when using arrays?

    • When you need to know the index position in an array - like if you're changing the value at a certain index location.
πŸ“˜ Unit 5 - AAP Part 2 β€” Previous
Arrays of Strings
Next β€” πŸ“˜ Unit 5 - AAP Part 2
Day 16