ITPEC IP October 2025 Question 6

Source exam: ITPEC IP October 2025Topic: Algorithm and Programming

ITPEC IP October 2025 — Question 6 of 100

A = 5000 and B = 0.8 — test the allowance-inclusive total and retain 80% after a 20% tax.

The first assignment already computes base salary plus 5% allowance. Tax applies when that monthlyTotalSal is greater than 5,000, so A is 5000. Deducting 20% leaves 100% - 20% = 80%, so the program multiplies the total by 0.8.

Answer (b)

Why not others:
- (a) multiplies by 0.2 and returns the tax amount rather than salary after tax

- (c) and (d) use 5,250, which would incorrectly reapply the allowance when defining the threshold

Key rule: Check which intermediate value a condition uses, and distinguish the deduction rate from the remaining proportion.

AI-generated — may contain errors

The original exam layout is preserved in the image so diagrams, formulas, tables, and code remain accurate.

This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official IP past-paper collection or Report an issue.