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
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.
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.
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.