1 ==============加法类================ 2 using System; 3 using System.Collections.Generic; 4 using System.Linq; 5 using System.Text; 6 using System.Threading.Tasks; 7 8 namespace Sj4.Entity 9 { 10 /// <summary> 11 /// 加法 12 /// </summary> 13 public class Jiafa : Operation 14 { 15 //计算方法 16 public override double GetResult() 17 { 18 if (NumberB == 0) 19 { 20 throw new Exception("不能为0"); 21 } 22 double result = NumberA + NumberB; 23 return result; 24 } 25 } 26 }
相关文章: