Which term describes a piece of data that can change during program execution?

Prepare for the Code.org Computer Science Discoveries test. Study with interactive quizzes and comprehensive explanations. Master key concepts and boost your confidence!

Multiple Choice

Which term describes a piece of data that can change during program execution?

Explanation:
A variable is a named container for data whose value can change as the program runs. You assign a value to it and later you can assign a new value, reflecting changes over time. For example, starting with a score of 0 and then adding points updates that variable's value. This ability to hold and update changing data is what makes a variable the right concept here. A class is a blueprint for objects, not a single piece of data that changes. A property is a characteristic of an object (which can vary), but the general term for changeable data in the flow of a program is variable. A sprite is just a graphic used in games, not the concept of changeable data itself.

A variable is a named container for data whose value can change as the program runs. You assign a value to it and later you can assign a new value, reflecting changes over time. For example, starting with a score of 0 and then adding points updates that variable's value. This ability to hold and update changing data is what makes a variable the right concept here.

A class is a blueprint for objects, not a single piece of data that changes. A property is a characteristic of an object (which can vary), but the general term for changeable data in the flow of a program is variable. A sprite is just a graphic used in games, not the concept of changeable data itself.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy