Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/StephenDoyle10/UK-Salary-Calculator
- Owner: StephenDoyle10
- Created: 2020-08-04T19:37:38.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-14T00:43:36.000Z (almost 2 years ago)
- Last Synced: 2023-02-23T09:06:55.972Z (over 1 year ago)
- Topics: algorithm, bootstrap, css, html, javascript, mocha
- Language: JavaScript
- Homepage: https://stephendoyle10.github.io/UK-Salary-Calculator/
- Size: 2.53 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
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 yearI 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.