QAProgramming › One advantage to using a named constant is that the statement becomes ____.
Q

One advantage to using a named constant is that the statement becomes ____.

A. Self-perpetuating

B. Self-documenting

C. Self-referencing

D. Self-mitigating

A

Answer: B. Self-documenting.

When a constant that is in use has been named (that is it has become known by an identifier), it becomes a self-documenting code. This means that it begins a sequence of programming languages that can be easily decoded by the author and/ or another programmer.

Naming a code makes it easier for code maintenance to occur. It also helps in the provision of a suitable name for constant numbers. e.g. Avogadro’s constant instead of 6.02214086×1023mol-1.

3 years ago
330 Views