|
namespace BusinessRules.Evolution_One
{
/// <summary>
/// Investor Domain object specific to the States
/// </summary>
public class UsaInvestor : IInvestor
{
#region Fields
private double income;
private double taxRate;
#endregion
#region C'tors
/// <summary>
/// Initializes a new instance of the <see cref="UsaInvestor"/> class.
/// </summary>
/// <param name="income">The income.</param>
public UsaInvestor(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 > 7550.99)
{
taxLiability += 7550.99 * 0.10;
}
if (inv_income >= 0.0 && inv_income <= 7550.99)
{
taxLiability += inv_income * 0.10;
}
if (inv_income > 30650.99)
{
taxLiability += (30650.99 - 7551.00) * 0.15;
}
if (inv_income >= 7551.00 && inv_income <= 30650.99)
{
taxLiability += (inv_income - 7551.00) * 0.15;
}
if (inv_income > 74200.99)
{
taxLiability += (74200.99 - 30651.00) * 0.25;
}
if (inv_income >= 30651.00 && inv_income <= 74200.99)
{
taxLiability += (inv_income - 30651.00) * 0.25;
}
if (inv_income > 154800.99)
{
taxLiability += (154800.99 - 74201.00) * 0.28;
}
if (inv_income >= 74201.00 && inv_income <= 154800.99)
{
taxLiability += (inv_income - 74201.00) * 0.28;
}
if (inv_income > 336550.99)
{
taxLiability += (336550.99 - 154801.00) * 0.33;
}
if (inv_income >= 154801.00 && inv_income <= 336550.99)
{
taxLiability += (inv_income - 154801.00) * 0.33;
}
if (inv_income > 336551.00)
{
taxLiability += (inv_income - 336551.00) * 0.35;
}
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 <= 7550.99)
taxRate = 0.10;
else if (inv_income >= 7551.00 && inv_income <= 30650.99)
taxRate = 0.15;
else if (inv_income >= 30651.00 && inv_income <= 74200.99)
taxRate = 0.25;
else if (inv_income >= 74201.00 && inv_income <= 154800.99)
taxRate = 0.28;
else if (inv_income >= 154801.00 && inv_income <= 336550.99)
taxRate = 0.33;
else
taxRate = 0.35;
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.