pxt-calliope/docs/lessons/headbands/quiz.md
Peli de Halleux 50367217f3
Lessons fixes (#1609)
* fixing a bunch of lessons

* more fixes

* more fixes

* more cleanup

* Additional fixes
2018-11-09 15:36:46 -08:00

1.0 KiB

headbands quiz

create a charades game with a collection of strings.

Name

Directions

Use this activity document to guide your work in the headbands tutorial.

Answer the questions while completing the tutorial. Pay attention to the dialogues!

1. What is the meaning of the term 'collection' in programming? What is a 'collection' of strings?



2. Write the line of code that will display the string "puppy" using coll.

let coll: string[] = []
coll.push("puppy")
coll.push("clock")

3. Write the line of code that will display the string "cat" using coll.

let coll: string[] = []
coll.push("puppy")
coll.push("clock")
coll.push("cat")

4. Write the five (5) lines of code that will add the following five words to coll: puppy, clock, night, cat, cow.

let coll : string[] = [];




5. Write the code to get a string from the collection at a random position.