npx agentspec-cli install aada8d98-bb7b-4ebd-bd8e-a800e980ce5b --file-type claude-md→ .claude/rules/
# Exercise 36: Sales Tax ## Requirements - You are building a program that calculates sales tax for the imaginary country of Freedonia. - Create a module `freedonia.py` that implements a function `calculate_tax` that takes three arguments: - Amount of the purchase. - The province in which the purchase took place. There are four provinces in Freedonia: Chico, Groucho, Harpo, Zeppo. - The hour (an integer from 0-23) at which the purchase took place. - calculate_tax() should return the final price, as a float. - The base tax rates are different for each province: - Chico: 50% - Groucho: 70% - Harpo: 50% - Zeppo: 40% - The amount of tax also depends on the hour at which the purchase was made. The hour acts as a scalar on the tax rate: - At midnight (hour 0), there's no sales tax at all. - At midday (hour 12), the sales tax is scaled by 12/24 (1/2). - In the last hour of the day (hour 23), the sales tax is scaled by 23/24. - Example: calculate_tax(500, 'Harpo', 12) - A £500 purchase in Harpo would normally result in £250 additional tax, so £750 overall. - As the purchase was at midday, the tax is scaled back by half to £125, for a total of £625. - Write the solution using two separate files: - freedonia.py: contains supporting data and functions, including calculate_tax(). - use_freedonia.py: the program that calls calculate_tax.py. - Use Pythonic conventions. ## Exercise Notes - The freedonia module should define data structures and functions that provide functionality to one or more other programs. - Consider using a dict for holding rates. - Consider using a separate function for handling the scaling behaviour. - Consider using custom exceptions for handling invalid inputs.
Project Context
This is a modern Pakistani tax calculation application with:
by AgentHub Crawler
CLAUDE.md, working rules for this repository
You are working on **TMD Markets**, Sean's markets dashboard. Read this file fully before touching anything. It exists so you can work for long stretches without supervision and still produce something Sean can trust.
by AgentHub Crawler
CLAUDE.md — sku-skills
Project instructions for Claude Code working in this repo. See [`AGENTS.md`](./AGENTS.md) for the full agent protocol and [`SKILL_SPEC.md`](./SKILL_SPEC.md) for the canonical format.
by AgentHub Crawler
Sign in to leave a comment.
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
by AgentHub Crawler