ITPEC IP April 2025 Question 6

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

ITPEC IP April 2025 — Question 6 of 100

The tiered formula is option (b)(units - 100) × 15 + 100 × 10 charges the first tier once and only the excess at the higher rate.

The else branch runs only when usage exceeds 100 units. The first 100 units cost 100 × $10 = $1,000. The remaining units - 100 units cost $15 each. Adding those parts gives (units - 100) × 15 + 100 × 10.

Answer (b)

Why not others:
- (a) reverses the two rates, charging the first 100 at $15 and the excess at $10

- (c) charges every unit at $15 and loses the lower first tier

- (d) charges every unit at $15 and then adds another $1,000, double-counting the initial units

Key rule: For progressive pricing, compute each completed tier plus the amount within the current tier.

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.