Unit conversion calculates an equivalent quantity in another unit. A practical conversion app accepts a numeric quantity, a from-unit, and a compatible to-unit, then displays the result. section 3.3
A useful unit-conversion app should:
- Prevent incompatible conversions, such as converting pounds to yards. section 3.3
- Support conversions within imperial or metric systems and across systems. section 3.3
- Make adding units or quantities straightforward for future maintenance. section 3.3
Scope example
Converting pounds to kilograms fits a simple conversion-factor model. Converting dollars to euros does not: changing exchange rates require current data from an online API, so currency conversion remains outside the initial scope. section 3.3.1
Treat the interface as the frontend: it collects inputs and displays results. Treat the conversion logic as the backend: it processes the input and returns the output. section 3.5
