Why is using named constants a good programming practice?

What will be an ideal response?

Using named constants is a good programming practice because it is less prone to the
introduction of bugs into the source code. A retail program that calculates customer purchases needs
to include sales tax on the amount of purchase. The sales tax percentage seldom changes, therefore
using a named constant whose value is set once reduces the risk of the programmer mistyping the
percentage, which would in turn introduce a logic error, the hardest error to track.

Computer Science & Information Technology

You might also like to view...

Why does a shell process terminate when you presses at the beginning of a new line?

What will be an ideal response?

Computer Science & Information Technology

What features does the current version of Wfetch offer?

What will be an ideal response?

Computer Science & Information Technology