A variable is a container for data, and the name used for accessing the variable is called the identifier. Students declare, initialize, and update variables for storing different types of program data (e.g., text, integers) using names and naming conventions (e.g. camel case) that clearly convey the purpose of the variable, facilitate debugging, and improve readability. For example, students could program a quiz game with a score variable (e.g. quizScore) that is initially set to zero and increases by increments of one each time the user answers a quiz question correctly and decreases by increments of one each time a user answers a quiz question incorrectly, resulting in a score that is either a positive or negative integer. (CA CCSS for Mathematics 6.NS.5) Alternatively, students could write a program that prompts the user for their name, stores the user's response in a variable (e.g. userName), and uses this variable to greet the user by name.
Standard detail
Depth 2Parent ID: 08996D1F00374B0086F27009ED1DBFE8Standard set: Level 2: Grades 6-8 (Ages 11-14)
Original statement
Quick facts
- Statement code
- Standard ID
- 133272241AC44D49B58F001D94337CCD
- Subject
- Computer Science
- Grades
- 06, 07, 08
- Ancestor IDs
- 08996D1F00374B0086F27009ED1DBFE8F9A16898F8F74394BFA27F0238BEE30F
- Source document
- CSTA K-12 Computer Science Standards (Revised 2017)
- License
- CC BY 4.0 US