Variables Conditionals and Functions 24 25 Resources
Variables Conditionals and Functions 24 25 Resources
'25)
Variables Explore
Resources
Guide to Debugging
Introduction to Debugging
Debugging is the process of finding and fixing problems in code. For most
programs, the time spent debugging far outweighs the time spent writing new
code. Whether students or professional engineers, all programmers get bugs,
and debugging is a normal part of the programming process.
Some bugs will keep the code from running at all, while others will run, but not
correctly, or will run for a while, then stop or suddenly do something unexpected.
All of those things are clues that will help the student find the bug in the next step.
You can encourage students to clearly describe the bugs they find by having them
write up bug reports, such as in their journal or this worksheet. As you foster a
positive culture around debugging, encourage students to write bug reports for
their classmates’ code as well as their own.
In many cases, students will introduce new bugs during the debugging process, especially if they are randomly changing
code as part of a “guess and check” method. Prompt them to explain why they are changing the code, and encourage
them to make small changes and test them often, making it easier to go back if their solution didn’t work.
Step 2 - Plan
Fill in the information in the table below for each event handler
you'll need to create
Fill in the table below for each variable you'll need to create.
Variable Name What the Variable Stores
Step 4 - Submit
Before you submit, check the rubric below to make sure your program meets the requirements of the task.
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 likes and the total of likes and the total amount of likes or of likes or the
comments. Sound comments. 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
function of all function of most of some onEvents.
onEvents. onEvents.
What is EIPM?
EIPM is a structured approach to teaching programming in Code.org's CSP Curriculum. It's designed to meet
the needs of diverse learners, encourage collaboration, support independent creation, and clarify the role of
the teacher throughout the learning process. Each letter represents a different type of lesson (E - Explore, I -
Investigate, P - Practice, M - Make) which are taught in sequence for each major programming construct. A
typical programming unit will feature 2 or 3 EIPM sequences, followed by a unit project and a multiple choice
assessment. The visual below shows that structure for Unit 5 - Lists, Loops and Traversals, with each square
being a separate lesson.
Overview Goal
● Close-reading of working
programs
● Teacher-led discussions
● Tasks to modify apps
What is EIPM?
EIPM is a structured approach to teaching programming in Code.org's CSP Curriculum. It's designed to meet
the needs of diverse learners, encourage collaboration, support independent creation, and clarify the role of
the teacher throughout the learning process. Each letter represents a different type of lesson (E - Explore, I -
Investigate, P - Practice, M - Make) which are taught in sequence for each major programming construct. A
typical programming unit will feature 2 or 3 EIPM sequences, followed by a unit project and a multiple choice
assessment. The visual below shows that structure for Unit 5 - Lists, Loops and Traversals, with each square
being a separate lesson.
Overview Goal
● Close-reading of working
programs
● Teacher-led discussions
● Tasks to modify apps
Introduction to Debugging
Debugging is the process of finding and fixing problems in code. For most
programs, the time spent debugging far outweighs the time spent writing new
code. Whether students or professional engineers, all programmers get bugs,
and debugging is a normal part of the programming process.
Some bugs will keep the code from running at all, while others will run, but not
correctly, or will run for a while, then stop or suddenly do something unexpected.
All of those things are clues that will help the student find the bug in the next step.
You can encourage students to clearly describe the bugs they find by having them
write up bug reports, such as in this worksheet. As you foster a positive culture
around debugging, encourage students to write bug reports for their classmates’
code as well as their own.
In many cases, students will introduce new bugs during the debugging process, especially if they are randomly changing
code as part of a “guess and check” method. Prompt them to explain why they are changing the code, and encourage
them to make small changes and test them often, making it easier to go back if their solution didn’t work.
What is EIPM?
EIPM is a structured approach to teaching programming in Code.org's CSP Curriculum. It's designed to meet
the needs of diverse learners, encourage collaboration, support independent creation, and clarify the role of
the teacher throughout the learning process. Each letter represents a different type of lesson (E - Explore, I -
Investigate, P - Practice, M - Make) which are taught in sequence for each major programming construct. A
typical programming unit will feature 2 or 3 EIPM sequences, followed by a unit project and a multiple choice
assessment. The visual below shows that structure for Unit 5 - Lists, Loops and Traversals, with each square
being a separate lesson.
Overview Goal
● Close-reading of working
programs
● Teacher-led discussions
● Tasks to modify apps
Step 2 - Plan
Fill in the information in the table below for each event handler
you'll need to create
Fill in the table below for each variable you'll need to create.
Variable Name What the Variable Stores
Step 4 - Submit
Before you submit, check the rubric below to make sure your program meets the requirements of the task.
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 likes and the total of likes and the total amount of likes or of likes or the
comments. Sound comments. 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
function of all function of most of some onEvents.
onEvents. onEvents.
Introduction to Debugging
Debugging is the process of finding and fixing problems in code. For most
programs, the time spent debugging far outweighs the time spent writing new
code. Whether students or professional engineers, all programmers get bugs,
and debugging is a normal part of the programming process.
Some bugs will keep the code from running at all, while others will run, but not
correctly, or will run for a while, then stop or suddenly do something unexpected.
All of those things are clues that will help the student find the bug in the next step.
You can encourage students to clearly describe the bugs they find by having them
write up bug reports, such as in their journal or this worksheet. As you foster a
positive culture around debugging, encourage students to write bug reports for
their classmates’ code as well as their own.
In many cases, students will introduce new bugs during the debugging process, especially if they are randomly changing
code as part of a “guess and check” method. Prompt them to explain why they are changing the code, and encourage
them to make small changes and test them often, making it easier to go back if their solution didn’t work.
Step 2 - Plan
Variables: Fill in the table below for each variable you'll need to create.
Variable Name What the Variable Stores
Conditionals: Draw a flowchart that follows the rules below. There's more than one way to do it. Use the table to make
sure that your flowchart works for different combinations of age, day, and discount code.
● On the weekends ("Saturday" and "Sunday") everyone pays full price of $10
● On weekdays (Monday through Friday) if you are 18 years or younger you pay $5.
● If you use the discount code "FREEFRIDAY" on a Friday you get in for $0. No other discount codes will work
and the code only works on Fridays.
Test Cases
18 Monday none $5
18 Tuesday FREEFRIDAY $5
50 Friday FREEFRIDAY $0
18 Friday FREE $5
Step 4 - Submit
Before you submit, check the rubric below to make sure your program meets the requirements of the task.
Input onEvents are onEvents are onEvents are onEvents are not
created for all the created for most of created for some of created for any
required inputs. the inputs. the inputs. inputs.
Storage: Variables Variables are created Most information is Some information is There are no
and appropriately stored in a variable stored in a variable variables which store
used for all pieces of and appropriately and appropriately the necessary
information used in updated throughout updated throughout information for the
the app. the app. the app. app to work correctly.
Processing: The code correctly The code correctly The code correctly The code does not
Conditional Logic determines the price determines the price determines the price correctly determine
for all combinations for most but not all for some but not all the price for any
of inputs (age, price, combinations of combinations of combination of inputs
discount code). inputs (age, price, inputs (age, price, (age, price, discount
discount code). discount code). code).
Code: Output The screen correctly The screen displays The screen displays The screen does not
displays the day, most but not all some but not all correctly display any
age, and price of the information correctly information correctly information in the
ticket. in the ticket. in the ticket. ticket.
Code runs without No errors are On or two errors are Three or four errors More than four errors
errors. present in the present in the are present in the are present in the
required code. required code. required code. required code.
Coding Comments Comments are used Comments are used Comments are used Comments are not
to correctly explain to explain the to explain the present.
the purpose and purpose and function purpose and function
function of all of most onEvents of some onEvents
onEvents and and conditional logic. and conditional logic.
conditional logic.
Style 1 Style 2
00 Feeling my way through the darkness 00 Feeling my way through the darkness
01 Guided by a beating heart 01 Guided by a beating heart
02 I can't tell where the journey will end 02 I can't tell where the journey will end
03 But I know where to start 03 But I know where to start
04 04
05 They tell me I'm too young to understand 05 They tell me I'm too young to understand
06 They say I'm caught up in a dream 06 They say I'm caught up in a dream
07 Well life will pass me by if I don't open up my eyes 07 Well life will pass me by if I don't open up my eyes
08 Well that's fine by me 08 Well that's fine by me
09 09
10 So wake me up when it's all over 10 Sing Chorus (the lyrics are below)
11 When I'm wiser and I'm older 11
12 All this time I was finding myself 12 Sing Chorus (the lyrics are below)
13 And I didn't know I was lost 13
14 14 I tried carrying the weight of the world
15 So wake me up when it's all over 15 But I only have two hands
16 When I'm wiser and I'm older 16 I hope I get the chance to travel the world
17 All this time I was finding myself 17 But I don't have any plans
18 And I didn't know I was lost 18
19 19 I wish that I could stay forever this young
20 I tried carrying the weight of the world 20 Not afraid to close my eyes
21 But I only have two hands 21 Life's a game made for everyone
22 I hope I get the chance to travel the world 22 And love is the prize
23 But I don't have any plans 23
24 I wish that I could stay forever this young 24 Sing Chorus (the lyrics are below)
25 Not afraid to close my eyes 25
26 Life's a game made for everyone 26 Sing Chorus (the lyrics are below)
27 And love is the prize 27
28 28 I didn't know I was lost
29 So wake me up when it's all over 29 I didn't know I was lost
30 When I'm wiser and I'm older 30 I didn't know I was lost
31 All this time I was finding myself 31 I didn't know I was lost
32 And I didn't know I was lost 32
33 33 Sing Chorus (the lyrics are below)
34 So wake me up when it's all over 34
35 When I'm wiser and I'm older 35 Chorus Lyrics:
36 All this time I was finding myself 36 So wake me up when it's all over
37 And I didn't know I was lost 37 When I'm wiser and I'm older
38 38 All this time I was finding myself
39 I didn't know I was lost 39 And I didn't know I was lost
40 I didn't know I was lost
41 I didn't know I was lost
42 I didn't know I was lost
43
44 So wake me up when it's all over
45 When I'm wiser and I'm older
46 All this time I was finding myself
47 And I didn't know I was lost
1
Variables, Conditionals, and Functions ('24-
'25)
Functions Make
Resources
Unit 4 Lesson 11
Name(s)_______________________________________________ Period ______ Date ___________________
Step 2 - Plan
Variables: Fill in the table below for each variable you'll need to create.
Variable Name What the Variable Stores
fontFamily
Conditionals: An if-else-if statement is used to check if certain options have been selected. Set up the conditional
below using the variables you created above.
● Note: You can be creative here! Choose your own combinations and feedback messages.
Functions: Consider what should be included in a function that updates the screen. Write out your plan below.
Things to think about:
● What elements on the screen need to be updated using the variables above?
● Does the conditional above belong in the function? Why or why not?
● When will the function be called?
Review the updateScreen() Pattern to help you plan
your function.
Inputs: What are the inputs for the app? These will all be turned into onEvents.
Input Action Result
"quoteInput" input The text on the screen appears, one character at a time as it's typed.
"fontFamilyInput" change
Step 4 - Submit
Before you submit, check the rubric below to make sure your program meets the requirements of the task.
Input onEvents are onEvents are onEvents are onEvents are not
created for all the created for most of created for some of created for any
required inputs. the inputs. the inputs. inputs.
Storage: Variables Variables are created Most information is Some information is There are no
and appropriately stored in a variable stored in a variable variables which store
used for all pieces of and appropriately and appropriately the necessary
information used in updated throughout updated throughout information for the
the app. the app. the app. app to work correctly.
Code: Functions A function is used A function is used A function is used There is no function
which correctly which correctly which updates some which updates the
updates all output updates most of the of the output screen.
elements. The output elements. The elements or the
function is called in function is called in function is only
all onEvents. all onEvents. called in some
onEvents.
Code runs without No errors are One or two errors Three or four errors More than four errors
errors. present in the are present in the are present in the are present in the
required code. required code. required code. required code.
Coding Comments Comments are used Comments are used Comments are used Comments are not
to correctly explain to explain the to explain the present.
the purpose and purpose and function purpose and function
function of all of most onEvents of some onEvents
onEvents and and functions. and functions.
functions.
U4 Practice PT Rubric
Rubric - Checklist
The User Interface is easy to navigate, it's clear how the app is
User Interface designed to be used, and all text is readable.
At least one number and one string are each stored in a variable
Code: Variables and used to make a decision.
App Development Planning guide is fully Planning guide is mostly Planning guide is Planning guide is not
Planning Guide: completed. completed. somewhat complete. complete.
Video Video shows the program Video shows the program Video shows the program No video was made.
running including input, running and two of the running and one of the
program functionality, and following: input, program following: input, program
output. functionality, and output. functionality, or output.
Written Response 1: Response accurately Response describes the Response partially Response does not
describes the purpose, purpose and functionality, describes the purpose and describe the purpose,
functionality, and or the inputs/outputs of functionality, or the functionality, and
inputs/outputs of the app. the app. inputs/outputs of the app. inputs/outputs of the app.
Written Response 2: Response clearly describes Response describes an Response describes an Response does not
an idea or recommendation idea or recommendation idea or recommendation describe an idea or
provided by a partner / peer provided by a partner / provided by a partner, but recommendation provided
and how it improved the app. peer and how it improved does not explain how it by a partner.
the app, lacking clarity. improved the app.
User Interface: The User Interface is easy to The User Interface is The User Interface is The User Interface is
navigate and it’s clear how mostly easy to navigate lacking in some readability difficult to navigate and it’s
the app is designed to be and it’s clear how the app or it’s not clear how to use not clear how the app is
used. All text is readable. is designed to be used. All the app. designed to be used. Text
text is readable. is unreadable.
Code: Warnings & Error No warnings or error A few warnings or error Many warnings or error The app does not run at
Messages messages appear when the messages appear when messages appear when all.
app is run. the app is run.. the app is run.
Code: Variables At least one number and One data type (numbers One variable stores either No variables are set up or
one String are each stored in or Strings) is stored in at a number or String and is used to make a decision.
a variable and used to make least two variables and used to make a decision.
a decision. used to make a decision.
Code: Function A function is used to update A function is used to A function is created to A function was not created
the screen. The function is update the screen. The update the screen but is to update the screen.
called at least two times in function is called one time not called in the program.
the program. in the program.
Code: Conditional A conditional is used inside A conditional is used A conditional is created No conditionals are
of the function to make a inside of the function to inside of the function, but present in the function.
decision based on make a decision based on does not use information
information stored in information stored in stored in variables to
variables. The conditional variables. The conditional make a decision or display
correctly uses a logical does not correctly use a it on the screen.
operator (&&, ||, or !) in the logical operator (&&, ||, or
Boolean expression. The !) in the Boolean
decision is displayed on the expression. The decision
screen. There are at least is displayed on the
three different responses screen. There are at least
that could be displayed. two different responses
that could be displayed.
Code: Comments The update screen function The update screen A comment is present, but No comments are present.
has a comment which clearly function has a comment it does not clearly explain
explains its purpose and which clearly explains its anything about the
functionality. purpose or functionality. function.
2
Variables, Conditionals, and Functions ('24-
'25)
Conditionals Practice (Alternative)
Resources
Guide to Debugging
Introduction to Debugging
Debugging is the process of finding and fixing problems in code. For most
programs, the time spent debugging far outweighs the time spent writing new
code. Whether students or professional engineers, all programmers get bugs,
and debugging is a normal part of the programming process.
Some bugs will keep the code from running at all, while others will run, but not
correctly, or will run for a while, then stop or suddenly do something unexpected.
All of those things are clues that will help the student find the bug in the next step.
You can encourage students to clearly describe the bugs they find by having them
write up bug reports, such as in this worksheet. As you foster a positive culture
around debugging, encourage students to write bug reports for their classmates’
code as well as their own.
In many cases, students will introduce new bugs during the debugging process, especially if they are randomly changing
code as part of a “guess and check” method. Prompt them to explain why they are changing the code, and encourage
them to make small changes and test them often, making it easier to go back if their solution didn’t work.