|
namespace BusinessRules.Evolution_One
{
/// <summary>
/// Investor Domain object specific to New Zealand
/// </summary>
public class NewZealandInvestor : IInvestor
{
#region Fields
private double income;
private double taxRate;
#endregion
#region C'tors
/// <summary>
/// Initializes a new instance of the <see cref="NewZealandInvestor"/> class.
/// </summary>
/// <param name="income">The income.</param>
public NewZealandInvestor(double income)
{
this.income = income;
}
#endregion
#region Properties
/// <summary>
/// Gets or sets the income.
/// </summary>
/// <value>The income.</value>
public double Income
{
get { return income; }
set { income = value; }
}
/// <summary>
/// Gets the tax liability.
/// </summary>
/// <value>The tax liability.</value>
public double TaxLiability
{
get
{
double taxLiability = 0.0;
double inv_income = Income;
if (inv_income > 19500.99)
{
taxLiability += 19500.99 * 0.195;
}
if (inv_income <= 19500.99)
{
taxLiability += inv_income * 0.195;
}
if (inv_income > 60000.99)
{
taxLiability += (60000.99 - 19501.00) * 0.33;
}
if (inv_income >= 19501.00 && inv_income <= 60000.99)
{
taxLiability += (inv_income - 19501.00) * 0.33;
}
if (inv_income > 60000.99)
{
taxLiability += (inv_income - 60000.99) * 0.39;
}
return taxLiability;
}
}
/// <summary>
/// Gets the tax rate.
/// </summary>
/// <value>The tax rate.</value>
public double TaxRate
{
get
{
double inv_income = Income;
if (inv_income >= 0.0 && inv_income <= 19500.99)
taxRate = 0.195;
else if (inv_income >= 19501.00 && inv_income <= 60000.99)
taxRate = 0.33;
else
taxRate = 0.39;
return taxRate;
}
}
#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.