AAmit’s LibraryLEARN · PRACTISE · REFLECT

Planning and branding × Programming

Business lens: Planning and branding · Technology lens: Programming

Reading scope: Original synthetic business-computing teaching with explicit boundaries. Primary links support selected background, not the invented organisations, figures or tested outcomes.

The promotion is an executable promise

A home-goods retailer plans a campaign offering ten per cent off a qualifying basket. Marketing supplies the message, finance supplies the price treatment and a programmer implements the calculation. The brand promise fails if these interpretations differ. Begin with the exact eligibility, stated price basis, exclusions, rounding and effective period that the business has approved. Treat the calculation as a translation of that policy, not a place for the developer to invent terms. A programme can apply a consistent rule very quickly, including a wrong one. The review must connect promotional language, checkout behaviour and the explanation available to customers and support staff.

Separate policy, arithmetic and effects

Put the bounded discount calculation in an inspectable function with explicit inputs and outputs. Keep eligibility and the policy version visible rather than embedding unexplained exceptions in display code. Use a consistent money representation and a stated rounding rule; integer minor units or carefully specified decimal arithmetic can support this exercise. Neither representation decides how a real offer should be defined. Separate price computation from charging, saving an order or sending a message so repeated calculation does not create an external effect. Return enough information to explain the calculation, and reject missing or invalid inputs rather than quietly turning them into a plausible zero.

A small numerical case with a boundary

For the synthetic qualifying basket of ₹1,250, ten per cent is ₹125 and the resulting price is ₹1,125 under the stated simple rule. For a basket of ₹500, the discount is ₹50 and the price is ₹450. These figures exclude tax, shipping, membership and any other adjustments; they are not a complete pricing or legal model. If the policy stipulates that only baskets of at least ₹1,000 qualify, the ₹500 basket receives no discount under that different rule. This contrast shows why correct multiplication does not establish a correct offer. Preserve the policy premise when comparing expected outputs with the implemented function.

Cross-department acceptance

Marketing checks whether the headline and detailed terms describe the same rule. Finance checks the agreed arithmetic and treatment boundaries. Sales and support test explanations using ordinary customer questions. Development owns implementation, input checks and reproducible tests. An authorised commercial owner accepts the policy and approves any change. Include a case at the eligibility boundary, a non-qualifying basket and a missing price, not only the attractive example used in the advertisement. Keep test expectations linked to the approved version. A dashboard showing many discounts applied cannot prove the campaign was understandable, profitable or faithful to the promised terms.

Failure and correction without erasing history

Suppose the live calculation applies the discount to an excluded item while the campaign text does not. Pause the affected path if appropriate, preserve the policy and calculation versions, and identify the orders that need review. Correcting code should not silently rewrite the historical price a customer actually saw or paid. Support needs an accountable explanation and finance needs a reconciliation process. Evaluate both over-discount and under-discount cases rather than noticing only revenue loss. The portfolio exercise proposes these operating controls; it does not prescribe statutory remedies or confirm the terms of a live promotion. Improvement requires evidence of corrected behaviour and clearer coordination across the departments.

Question words and learning depth

Who approves eligibility? Whom may the wording confuse? Whose price source feeds the function? What adjustments are excluded from the model? Where is the policy version retained? When does the offer apply? Why can correct arithmetic implement the wrong promise? Which boundary tests reveal interpretation gaps? How are affected orders reviewed after correction? Foundation learners explain a discount in ordinary language. Undergraduate learners compute examples and specify the function. Postgraduate learners compare policy alternatives and failure consequences. Research learners study whether explanatory calculations reduce offer misunderstandings, considering customer mix and message design. Submit the policy statement, test table and a correction memo with clearly bounded financial assumptions.

Study questions and answers

Compute the two discounts under the simple rule.

₹1,250 receives ₹125 off, leaving ₹1,125; ₹500 receives ₹50 off, leaving ₹450. These exclude other adjustments.

Marking guide: Credit reductions 125 and 50, leaving 1,125 and 450 for the two stipulated baskets. State that other adjustments are excluded.

What changes if the approved minimum qualifying basket is ₹1,000?

The ₹500 basket does not qualify, so its price remains ₹500 under that stipulated policy.

Marking guide: Credit failure of the 500 basket to meet the stipulated 1,000 threshold and unchanged price 500. Explain eligibility before applying arithmetic.

Does decimal arithmetic prove the offer is correct?

No. It supports stated numeric behaviour; eligibility, rounding, exclusions and customer promises still require explicit policy review.

Marking guide: Credit numeric implementation versus correct approved offer. Require eligibility, rounding, exclusions and promise review beyond use of decimal arithmetic.

Practice task

Write a bounded promotional policy, five function test cases and an order-correction procedure. No live payment operation is part of this task.

Sources and further reading

  • Python documentation — Decimal arithmetic
    Scope: Selected numeric representation and rounding background checked. Promotional cases use explicitly stipulated business assumptions, not a financial or tax prescription.
    Access: Public selected reading available without an account in this check. Certificates, webinar playback, hosted execution and service entitlements were not checked.

Related chapters

Interactive practice

Open workshop

Open interactive matrix reading