Lesson 4.2 Variables Investigate
Sept 13 (A-day) and Sept 14 (B-day)
Sept 13 (A-day) and Sept 14 (B-day)
•
getText()
declaring a variable
expression
If you need to review the activity look in the left column for the asynchronous video lesson
Code.org Assignment
Walk through Code.org U4L2 bubbles
Wrap-Up - Make sure you have the vocabulary in your Memory Minder. Then complete the Check for Understanding questions in Code.org
variable: a reference to a value or expression that can be used repeatedly throughout a program.
var: the keyword used to declare a variable
concatenation: adding strings of information together using +
In this lesson students work with partners to investigate several versions of the "Thermostat App" to understand how variables store and update information. To begin, students examine a version of the app where the temperature displayed changes each time a button is clicked. The next two versions of the app demonstrate how variables can store strings. Students learn about the patterns they are observing, specifically "Counter Pattern with Event" and "Variables with String Concatenation Pattern". To conclude the lesson, students review and discuss the programming patterns that they will make use of in the programs they write.
After building a conceptual model for variables in the previous lesson, students investigate three working examples of apps that make use of variables. This lesson also introduces common programming patterns when using variables. Students will have some opportunities to modify working code in this lesson, but the most significant practice with variables will come in the following lesson.
CSP Conceptual Framework
AAP-1 - To find specific solutions to generalizable problems, programmers represent and organize data in multiple ways.
AAP-2 - The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values.
CSTA K-12 Computer Science Standards (2017)
AP - Algorithms & Programming
2-AP-11 - Create clearly named variables that represent different data types and perform operations on their values.
3B-AP-23 - Evaluate key qualities of a program through a process such as a code review.