How the Turkey mtv calculator is verified

Inputs

InputFieldType
Motor hacmi (cm³)ccnumber
Araç yaşı (yıl)ageYearsnumber

The formula

Each derived value below is computed by the Valem engine from the expression shown, in this order. Nothing else runs — there is no hidden code path.

Derived valueFieldFormula (JSONata)
Motor bandı tutarıccRate($c := cc; $c <= 1300 ? 2500 : $c <= 1600 ? 4000 : $c <= 1800 ? 7000 : $c <= 2000 ? 11000 : 22000)
Yaş katsayısıageFactor($a := ageYears; $a <= 3 ? 1.0 : $a <= 6 ? 0.85 : $a <= 11 ? 0.65 : $a <= 15 ? 0.5 : 0.4)
Yıllık MTVmtv$round(ccRate * ageFactor, 2)

Test vectors (2)

Every case is executed against this model on each build, by the Java engine and independently by a JavaScript one. A mismatch of a single cent fails the build, so the page cannot ship advertising a figure the model no longer produces.

Case 1 — C1 1.6 L, 1 year old

given cc1600
given ageYears1
expect ccRate4000
expect ageFactor1
expect mtv4000

Case 2 — C2 2.0 L, 7 years old

given cc2000
given ageYears7
expect ccRate11000
expect ageFactor0.65
expect mtv7150

Sources

Check it yourself — and reuse it

The whole model as JSON — inputs, outputs, formulas, vectors and sources in one re-runnable document.

This model is published under CC BY 4.0: use it, adapt it, build on it, with attribution. The licence covers the model — the expression of each rule and the arrangement of the catalog. The rates and thresholds are law, and nobody licenses those; the sources above are where they come from.

← Back to the Turkey mtv calculator

Built with Valem — a live, verifiable calculator you can fork and embed.