Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/StephenDoyle10/UK-Salary-Calculator

Front-end. Interactive JavaScript on this project enables one to input their salary to find out what their take home pay is, and how much in income tax and national insurance they are deducted.
https://github.com/StephenDoyle10/UK-Salary-Calculator

algorithm bootstrap css html javascript mocha

Last synced: 23 days ago
JSON representation

Front-end. Interactive JavaScript on this project enables one to input their salary to find out what their take home pay is, and how much in income tax and national insurance they are deducted.

Awesome Lists containing this project

README

        

The project can be viewed online here: https://stephendoyle10.github.io/UK-Salary-Calculator/

This project uses an algorithm that takes a user's annual gross salary as an input, and outputs:
1. the user's annual pay after all tax deductions
2. the user's monthly pay after all tax deductions
3. how much the user will pay in income tax in the year
4. how much the user will pay in national insurance contributions in the year

I felt that UK tax rules were sufficiently complex enough that this would be a good demonstration of my algorithm writing ability.

The algorithm had to account for both income tax and national insurance contributions.

Regarding income tax, the algorithm had to account for the following:
1. employees pay 0% on earnings up to £12,500
2. employees then pay 20% on anything they earn between £12,501 and £50,000
3. they pay 40% Income Tax on earnings between £50,001 to £150,000
4. they pay 45% on earnings over £150,001

Regarding National Insurance contributions, the algorithm had to account for the following:
1. employees only start to pay National Insurance contributions if they earn more than £183 a week
2. they pay 12% of their earnings above this limit and up to £962 a week
3. the rate drops to 2% of their earnings over £962 a week.

This project also uses Mocha testing to check that the algorithm works for a number of different test cases.