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
Answer and explanation
Concise answer
It can make the program easier to understand and update
Why this is correct
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.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
