Computer Science: An Overview: Global Edition (12th Edition)

Published by Pearson Higher Education
ISBN 10: 1292061162
ISBN 13: 978-1-29206-116-0

Chapter 6 - Programming Languages - Chapter Review Problems - Page 324: 12

Answer

See explanation ​

Work Step by Step

John Programmer’s argument is technically true — you can use a variable and assign it a value at the beginning of the program — but this approach has several drawbacks compared to using a constant. Declaring a constant is better because: 1. Prevents accidental modification 2. Makes the code easier to understand 3. Facilitates maintainability 4. Enables compiler optimizations Therefore using a constant improves safety, readability, and maintainability. It prevents accidental errors and clearly communicates the programmer’s intent that the value should never change.
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.