Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
tax cal
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { const int topRateThreshold = 1000000; const int higherRateThreshold = 500000; const int basicRateThreshold = 250000; const decimal topRateFactor = 0.30M; const decimal higherRateFactor = 0.20M; const decimal basicRateFactor = 0.05M; decimal salaryWorkingRange = 1800000; decimal taxDue = 0; if (salaryWorkingRange > topRateThreshold) { Console.WriteLine("top Tax "+(salaryWorkingRange - topRateThreshold) * topRateFactor); taxDue += (salaryWorkingRange - topRateThreshold) * topRateFactor; salaryWorkingRange = topRateThreshold; } if (salaryWorkingRange > higherRateThreshold) { Console.WriteLine("middle Tax "+(salaryWorkingRange - higherRateThreshold) * higherRateFactor); taxDue += (salaryWorkingRange - higherRateThreshold) * higherRateFactor; salaryWorkingRange = higherRateThreshold; } if (salaryWorkingRange > basicRateThreshold) { Console.WriteLine("last Tax "+(salaryWorkingRange - basicRateThreshold) * basicRateFactor); taxDue += (salaryWorkingRange - basicRateThreshold) * basicRateFactor; } Console.WriteLine("Total Tax "+taxDue+" Tax per month "+taxDue/12); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
equation with a variable on the 2nd power
Fórum Parallel Threads ( Without Fun )
Exception-Nikhil
Testing 008
Side 1
ckm9lgusa05fg0o0sez8h72ry8GTV
01-SI
sdefuy6j87uytgr
LINQ Collections
decimal to binary conversion
Please log in to post a comment.