Multiple choice

The provident fund (PF) contribution rate for employees was hardly coded (made part of the program) in a payroll system. Whenever rate changes, it meant program modification. Which of the following is most appropriate?

  1. It would have been better to have designed PF rates to be input from the console

  2. It would have been more efficient to have designed PF rates as batch inputs

  3. Hard coding has helped in minimizing input errors and in faster execution time

  4. Data that changes rarely can be hardly coded

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Hard coding values that rarely change is a standard practice in software development to avoid unnecessary complexity. If a value changes frequently, it should be externalized, but for static or rarely changing data, hard coding is acceptable.