In 2014, there are 4 edges which have their own tax rate: From
Rp 0
toRp 50,000,000
the tax rate is5%
. FromRp 50,000,000
toRp 250,000,000
the tax rate is15%
. FromRp 250,000,000
toRp 500,000,000
the tax rate is25%
. Above500,000,000
the tax rate is30%
.
Examples:
- If your annual taxable income is
Rp 75,000,000
. Your annual income tax amount will be:5%*50,000,000 + 15%*25,000,000 = 2,500,000 + 3,750,000 = Rp 6,250,000
- If your annual taxable income is
Rp 750,000,000
, Your annual income tax amount will be:5%*50,000,000 + 15%*200,000,000 + 25%*250,000,000 + 30%*250,000,000 = 2,500,000 + 30,000,000 + 62,500,000 + 75,000,000 = Rp 170,000,000
Task : Write a program in TDD to calculate the annual income tax above.
Le code réalisant le calcul se trouve dans ./index.js
, les tests étant dans ./test.js
.