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

U4l04 Variables Make

This document provides instructions for an activity where students will write code for a photo liker app using variables. It outlines 4 steps: 1) trying out the app to understand its functionality, 2) planning the event handlers and variables needed, 3) writing the code, and 4) posting the completed app. The code will include event handlers for like, dislike, and comment buttons that update variable values to track likes and comments. A rubric is provided to evaluate the completed code.

Uploaded by

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

U4l04 Variables Make

This document provides instructions for an activity where students will write code for a photo liker app using variables. It outlines 4 steps: 1) trying out the app to understand its functionality, 2) planning the event handlers and variables needed, 3) writing the code, and 4) posting the completed app. The code will include event handlers for like, dislike, and comment buttons that update variable values to track likes and comments. A rubric is provided to evaluate the completed code.

Uploaded by

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

Variables Make

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?
○ What are the inputs?
○ What are the outputs?
○ What's one piece of information that might be
stored in a variable?

Step 2 - Plan
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

Like and dislike button


Make you be able to like or dislike

Comment button
Commenting

Likes shower
Shows likes

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

Comment

Will let me comment

Button
Will let me like and dislike

Computer Science Principles 1


Variables Make
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 - Post
You will post your app on your create task page on your website.

Before your submit check the rubric below to make sure your program

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
and understandable correctly.
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 likes and the total of likes and the total amount of likes or of likes or the
comments. Sound comments. the some amount of comments.
plays when different comments.
buttons are clicked.

Code runs without No errors are At most one error is Some errors are Many errors are
errors. present 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

Computer Science Principles 2


Variables Make

function of all function of most of some onEvents.


onEvents. onEvents.

Computer Science Principles 3

You might also like