コード例 #1
0
ファイル: Money.cs プロジェクト: RomeoKyyv/MA_CSharp16
        public static bool operator <(Money Amount1, Money Amount2)
        {
            double c        = Amount1.Course(Amount1, Amount2);
            bool   compare2 = Amount1.Amount < (Amount2.Amount * c);

            return(compare2);
        }
コード例 #2
0
ファイル: Money.cs プロジェクト: RomeoKyyv/MA_CSharp16
        // 4) declare overloading of operator + to add 2 objects of Money
        public static Money operator +(Money Amount1, Money Amount2)
        {
            double c = Amount1.Course(Amount1, Amount2);

            return(new Money(Amount1.Amount + Amount2.Amount * c, Amount1.CurrencyType));
        }