0% found this document useful (0 votes)
40 views2 pages

Activity Guide - Loops Make

Uploaded by

1180
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views2 pages

Activity Guide - Loops Make

Uploaded by

1180
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Unit 5 Lesson 8

Name(s)_______________________________________________ Period ______ Date ___________________

Activity Guide - Loops Make


Step 1 - Try the app
Try making tickets for different combinations of inputs.
● What does each button change and what does it not
change? "home
Discuss with a Partner
● Where (if at all) do you think this app is using a list? Twenty
● Where (if at all) do you think this app is using a loop?

"color
"locati
Step 2 - Plan
"shap
Fill in the information in the table below for each event handler you'll need to create

Element ID Description of What the Event Handler will Do

colorsButton

Randomly changes color of all the shapes

locationsButton
Randomly change the locations of all the shapes

shapesButton Change to the next shape for all the shapes

Fill in the table below for each variable you'll need to create.
Variable Name What the Variable Stores

iconIndex Which shape is currently being used

iconsList It’s the placeholder for the current size of the Icon

Computer Science Principles 1


Unit 5 Lesson 8
Step 3 - Write Your Code
● Write the code for the app, using your plan above and the comments provided in Code Studio to help
● Steps You Can Follow
○ Create all the variables from your table above.
○ Give your variables a starting value using the assignment operator (=)
○ Create blank event handlers (onEvent) for each screen element in your table above
○ Write the code to make each of the three buttons work.
○ HInt: in order to create random colors use the rgba() block with randomNumber(). Read the
documentation for those blocks if you need more help.
○ Use your debugging skills to identify unexpected behavior and fix your program
○ Comment your code as you go, explaining what each event handler does
○ Check the Help & Tips tab for ideas about Programming Patterns you can use
● Extension Ideas
○ Create a way to hide the three buttons when you have a lock screen that you like
○ Add sounds to each button
○ Change the code for the "shapes" button to guarantee that you never randomly get the same shape
twice in a row.

Step 4 - Submit
Before your submit check the rubric below to make sure your program

Category Extensive Evidence Convincing Evidence Limited Evidence No Evidence

Input onEvents are created onEvents are created onEvents are created onEvents are not
for all the required for most of the inputs. for some of the inputs. created for any inputs.
inputs.

Variables and Variables and lists are Variables and lists are Some information is There are no variables
Lists created and created and stored in variables and or lists which store the
appropriately used for appropriately used for lists and appropriately necessary information
all pieces of most pieces of updated throughout for the app to work
information used in the information used in the the app. correctly.
app. app.

Loops The program correctly The program correctly The program correctly The program does not
uses loops for all three uses a loop for two of uses lists for one of include or correctly
buttons to generate the buttons to the buttons to use any loops.
the expected output. generate the expected generate the expected
output. output.

Output All three buttons work Only two of the Only one of the None of the buttons
as expected to move buttons work as buttons work as work as expected.
icons, change their expected. expected.
colors, and change
their icon to a random
new icon.

Code runs No errors are present Some errors are Many errors are The code does not
without errors. in the required code. present in the required present in the required run.
code. code.

Comments Comments are used to Comments are used to Comments are Comments are not
correctly explain the explain the purpose present, but are not present.
purpose and and functionality of used to explain the
functionality of both either the function or purpose or
the function and conditional logic. functionality of the
conditional logic. function or conditional
logic.

Computer Science Principles 2

You might also like