個人所得稅 = (基本工資 * 5% + 獎金 * 25%)
根據前面為中國企業建模經驗,我們僅僅將ChineseTax、ChineseBonus修改為AmericanTax、AmericanBonus。 修改后的模型如下:
則業務規則Service類的代碼如下:
1using System;
2
3namespace AmericanSalary
4{
5 /**//// <summary>
6 /// 公用的常量
7 /// </summary>
8 public class Constant
9 {
10 public static double BASE_SALARY = 4000;
11 }
12}
13
1using System;
2
3namespace AmericanSalary
4{
5 /**//// <summary>
6 /// 計算美國個人獎金
7 /// </summary>
8 public class AmericanBonus
9 {
10 public double Calculate()
11 {
12 return Constant.BASE_SALARY * 0.1;
13 }
14 }
15}
16
文章來源于領測軟件測試網 http://www.kjueaiud.com/