Exam-style question
Try this first
What is one advantage of using a named constant instead of repeatedly writing the same literal value?.
- A.It makes the value impossible for the program to use
- B.It can make the program easier to understand and update
- C.It guarantees that the program contains no errors
- D.It means that all variables become constants
Model answer
What a good answer should say
- It can make the program easier to understand and update
Explanation
Why this works
A meaningful name communicates the purpose of the value. If the value needs changing, it can be changed in one named declaration rather than in multiple places.
Common mistake
No common mistake is linked to this question yet.
