|
namespace BusinessRules.Evolution_Four
{
/// <summary>
/// Australian Income Tax Engine Domain object specific to australian tax rules.
/// </summary>
internal class AustralianIncomeTaxEngine : IncomeTaxEngine
{
#region Methods
/// <summary>
/// Calculates the tax rate.
/// </summary>
/// <returns>
/// Returns a double representing the tax liability for the investor.
/// </returns>
public override Calculation<Investor> CalculateTaxRate()
{
return delegate(Investor investor)
{
double income = investor.Income;
if (income >= 0.0 && income <= 6000.99)
return 0.0;
else if (income >= 6001.00 && income <= 25000.99)
return 0.15;
else if (income >= 25001.00 && income <= 75000.99)
return 0.30;
else if (income >= 75001.00 && income <= 150000.99)
return 0.40;
else
return 0.45;
};
}
/// <summary>
/// Calculates the tax liability.
/// </summary>
/// <returns>
/// Returns a double representing the tax rate for the investor.
/// </returns>
public override Calculation<Investor> CalculateTaxLiability()
{
return delegate(Investor investor)
{
double taxLiability = 0.0;
double income = investor.Income;
if (income >= 6001.00 && income <= 25000.99)
{
taxLiability += (income - 6000.99) * 0.15;
}
if (income > 25000.99)
{
taxLiability += (25000.99 - 6001.00) * 0.15;
}
if (income > 75000.99)
{
taxLiability += (75000.99 - 25001.00) * 0.30;
}
if (income >= 25001.00 && income <= 75000.99)
{
taxLiability += (income - 25001.00) * 0.30;
}
if (income > 150000.99)
{
taxLiability += (150000.99 - 75001.00) * 0.40;
}
if (income >= 75001.00 && income <= 150000.99)
{
taxLiability += (income - 75001.00) * 0.40;
}
if (income > 150000.99)
{
taxLiability += (income - 150000.99) * 0.45;
}
return taxLiability;
};
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.