Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
Last active December 21, 2021 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save McLarenCollege/67f9a1b84f38cad71fe57d8d06583b78 to your computer and use it in GitHub Desktop.
Save McLarenCollege/67f9a1b84f38cad71fe57d8d06583b78 to your computer and use it in GitHub Desktop.
Exercise Name : UK Tax Band Calculation

Calcuate Tax Amount

Here are the UK tax bands for 2021 as described by the UK tax authority:

Taxable Income Tax Rate
£0 to £12,500 0%
£12,501 to £50,000 20%
£50,001 to £150,000 40%
over £150,000 45%

Given the taxable income amount, write the code the tax amount based on the above table.

For example,

let taxableIncome = 10000;
let taxAmount =  0
let taxableIncome = 12600;
let taxAmount =   20
let taxableIncome = 51000;
let taxAmount =  7900
let taxableIncome = 180000;
let taxAmount =  61000

Exercises :

let taxableIncome = 20000;
let taxAmount = ;
let taxableIncome = 50010;
let taxAmount = ;//
let taxableIncome = 155000;
let taxAmount = ;//

Here is the link for the video explaination for the above problem https://mclarencollege.com/player.html?videoUrl=https%3A%2F%2Fmclaren-college-lecture-recordings.s3.us-east-2.amazonaws.com%2Fin-class_videos%2FJavascript_Foundations%2Fuk%2Btax%2Bband%2Bproblem.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment