Iteration Worksheet

0. Explain how a foreach block works.



1. Sketch the blocks for an app that, on a button click, adds up a list of numbers. The app should use a foreach loop and display the sum in a label. Here are some of the necessary blocks:








2. a. Sketch the blocks for an app that speaks out the words in the list "colores", one every five seconds. Here are some of the necessary blocks:










b. Why won't a foreach block work for this app?
Comments