Examlex

Solved

A Programmer Notices That the Following Code Snippet Uses the Same

question 13

Multiple Choice

A programmer notices that the following code snippet uses the same algorithm for computing cost after taxes, but with different variables, in the two places as shown below, and in several other places in the program. What could be done to improve the program?
Final double TAXRATE1 = 10;
Final double TAXRATE2 = 5.5;
Double subtotal = price * (1 + TAXRATE1) / 100;
Double total = subtotal + shipping * (1 + TAXRATE2) / 100;


Definitions:

Known Liabilities

Obligations that are quantifiable, and the company is aware of, including debts and other financial responsibilities that appear on the balance sheet.

Employee Earnings Report

A detailed record that shows the amount of money an employee has earned over a particular period, including wages, bonuses, and deductions.

Gross Earnings

The total amount of money earned by an individual or organization before any deductions are made.

Contingent Liabilities

Contingent liabilities are potential liabilities that may occur depending on the outcome of a future event, and are recorded in the company's financial statements if probable and estimable.

Related Questions