In an accounting application, you discover several places where the total profit, a double value, is calculated. Which of the following should be done to improve the program design?
AThe next time the total profit is calculated, use copy and paste to avoid making coding errors.
BProvide the same comment every time you repeat the total profit calculation.
CConsider writing a function that returns the total profit as a double value.
DAll of the listed items.
AThe next time the total profit is calculated, use copy and paste to avoid making coding errors.
BProvide the same comment every time you repeat the total profit calculation.
CConsider writing a function that returns the total profit as a double value.
DAll of the listed items.