21 Arrays
What are arrays and in what ways can we use them?
Vocabulary
Arrays, index, element, zero-indexed
Study Questions
- What does it mean for an array to be zero-indexed?
- Name some ways to make use of arrays in a program?
- How can we choose random elements from an array?
- How can a loop be used to iterate through an array?
Activity
- Watch Video #1 (below)
- Create a Fortune Cookie Message Generator
- Create an array that holds 10 fortune cookie messages. Use google search or link provided below in resources to get some messages.
- Style your printed text! Use fonts from Google Fonts and different font-styles.
- Style the background using a for loop and in a theme related to the words ‘fortune cookie’.
- Name your sketch and comment your code.
- Use camelCase for variable, function names, or where ever appropriate.
- Use variables for modifiable colors and other elements that the user could set at the top of the program.
- Use functions for blocks of reusable code.
- Discuss the answers to study questions.
Resources
- Video: 21 Arrays
- Link: Funny Fortune Cookie Sayings
- Link: Google Fonts