0% found this document useful (0 votes)
122 views

Activity Guide - Variables Make - Unit 4 Lesson 4

The document provides instructions for an activity where students will write code to create a photo liker app. It includes steps to try using the app prototype, plan the variables and event handlers needed, and then write the code. The code is to include event handlers for buttons that increment a like counter, add comments, and display the running totals. Variables will be needed to store the like count and comments. The document provides a rubric to check that the required elements are included in the submitted code.

Uploaded by

Anneke Lopez
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
122 views

Activity Guide - Variables Make - Unit 4 Lesson 4

The document provides instructions for an activity where students will write code to create a photo liker app. It includes steps to try using the app prototype, plan the variables and event handlers needed, and then write the code. The code is to include event handlers for buttons that increment a like counter, add comments, and display the running totals. Variables will be needed to store the like count and comments. The document provides a rubric to check that the required elements are included in the submitted code.

Uploaded by

Anneke Lopez
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Unit 4 Lesson 4

Name(s)_______________________________________________ Period ______ Date ___________________

Activity Guide - Variables Make


Your Goal: Write the code to make the Photo Liker App. You've
already been given every screen element and have comments
that will help you design your program.

Step 1 - Try using this app


● Try all of the buttons and add a comment to the picture
● Discuss with a Partner
○ What does this app do? "up
"doBu
○ What are the inputs?
○ What are the outputs?
"likeCo
○ What's one piece of information that might be wnB tto "newCo
unterO
stored in a variable? "allCom
utton n" "com
mmentIn
utput"
mentsO
" mentB
put"
Step 2 - Plan
Fill in the information in the table below for each event handler
utput" utton"
you'll need to create

Element ID Description of What the Event Handler will Do

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

Computer Science Principles 1


Unit 4 Lesson 4
Step 3 - Write Your Code
● Write the code for the app, using your plan above and the comments provided in Code Studio to help
● Step 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 the "upButton" work and test it out. If it's working correctly, the "Likes" count
should go up by one every time you click it
○ Write code to make the "downButton" work and test it.
○ Write code to make the "commentButton" work
○ 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
○ Set the text in "new_comment" to blank after the comment has been added
○ Add sounds to each button

Step 4 - Submit
Before you submit, check the rubric below to make sure your program meets the requirements of the task.

Category Extensive Evidence Convincing Limited Evidence No Evidence


Evidence

Code: Event onEvents are defined onEvents are defined onEvents are defined onEvents are not
Handlers Created for all the required for most of the for some of the designed for any
buttons. required buttons. buttons. buttons.

Code: Variables Variables are defined Variables are defined One variable is There are no
to store the amount to store the amount present that stores variables which store
of likes and the of likes and the either the amount of the necessary
comments. Variables comments likes or the information for the
are named in a clear comments app to work correctly.
and understandable
way.

Code: Event All necessary Most necessary Some of the None of the
Handlers Written variables are variables are necessary variables necessary variables
updated inside of the updated inside of the are updated inside of are updated inside of
onEvents. onEvents. the onEvents. the onEvents.

Code: Output The screen correctly The screen correctly The screen correctly The screen does not
Information displays the amount displays the amount displays either the display the amount of
of likes and the total of likes and the total amount of likes or likes or the
comments. Sound comments. the some amount of comments.
plays when different comments.
buttons are clicked.

Code runs without No errors are present At most one error is Some errors are Many errors are
errors. in the code. present in the code. present in the code. present in the code.

Coding Comments Comments are used Comments are used Comments are used Comments are not
to correctly explain to correctly explain to explain the present
the purpose and the purpose and purpose and function
function of all function of most of some onEvents.
onEvents. onEvents.

Computer Science Principles 2

You might also like