Constants and Variables Flashcards
What can be stored as constants or variables?
Data types
What is the name of a constant or variable linked to?
Memory location that stores the data value.
What does the size of the memory location rely on?
The data type.
How does a constant work?
It’s assigned to a data value at design time that can’t be changed. The constant remains the same.
What happens if you try change the value of a constant?
The interpreter or compiler will return an error.
What makes variables more useful than constants?
They can have their data values changed but NOT their data type.
What often needs to happen to be able to use variables or constants in a program?
They need to be declared at the start.
How can you make the code to easier follow for constants and variables?
Follow standard naming conventions.