Professional Documents
Culture Documents
CSP U5l06 Activity Guide
CSP U5l06 Activity Guide
Warm-Up - Imagine you are interested in finding out how much time it takes on average to walk
from one end of your school to the next. You've decided to figure this out on your lunch break, and
are able to complete the walk 20 times. What would your algorithm look like? Where could a loop
show up?
Note: You do not need to write your algorithm in a programming language. You can write it out in
English or in pseudocode. Also, do not spend too much time on this part (under 5 minutes).
____________________________________________________________
Level 2 - Run the app on Level 2 of Code Studio then answer the following questions
1. What information does the user input?
How many times the coin flips.
3. Which lines of code decide how many times to flip the coin?
7,10,6,4
4. What does the ++ command seem to do
For example: tails++.
____________________________________________________________
Level 4 - Run the program on Level 4, paying attention to the code
1. Find four different for loops in the program. What do they each do?
7,12,18,23,28 they make sure the text shows up in all the boxes.
2. Take a look at the names of the screen elements in Design Mode. Then navigate back to
the code. How is "text" + i used? How does it evaluate with each round of the loop?
The text+i input means the function is repeating the text i loop function.
3. What happens if you change the text box variable names? Try changing them from text0,
text1, etc. to textbox0, textbox1, etc. What do you need to change in the code for the
program to still work? Not going to work, not labeled properly.
4. What happens if you change the Boolean expression i < 5 in the for loops? Change all the
Boolean expressions to each of these options and explain what happens:
a. i < 4
b. i < 3
c. i <= 4
5. Change it to text box