示例#1
0
        public static Money02 operator +(Money02 money1, Money02 money2)
        {
            Money02 sum = new Money02(
                money1.OneCentCount + money2.OneCentCount,
                money1.FiveCentCount + money2.FiveCentCount,
                money1.TenCentCount + money2.TenCentCount,
                money1.QuarterCount + money2.QuarterCount,
                money1.OneDollarCount + money2.OneDollarCount,
                money1.FiveDollarCount + money2.FiveDollarCount,
                money1.TenDollarCount + money2.TenDollarCount,
                money1.TwentyDollarCount + money2.TwentyDollarCount);

            return(sum);
        }
示例#2
0
        //public void InsertMoney(
        //    int oneCentCount,
        //    int fiveCentCount,
        //    int tenCentCount,
        //    int quarterCount,
        //    int oneDollarCount,
        //    int fiveDollarCount,
        //    int tenDollarCount,
        //    int twentyDollarCount)
        //{
        //    OneCentCountInTransaction += oneCentCount;
        //    FiveCentCountInTransaction += fiveCentCount;
        //    TenCentCountInTransaction += tenCentCount;
        //    QuarterCountInTransaction += quarterCount;
        //    OneDollarCountInTransaction += oneDollarCount;
        //    FiveDollarCountInTransaction += fiveDollarCount;
        //    TenDollarCountInTransaction += tenDollarCount;
        //    TwentyDollarCountInTransaction += twentyDollarCount;
        //}

        public void ReturnMoney()
        {
            MoneyInTransaction = None;
        }
示例#3
0
        //public void ReturnMoney()
        //{
        //    OneCentCountInTransaction = 0;
        //    FiveCentCountInTransaction = 0;
        //    TenCentCountInTransaction = 0;
        //    QuarterCountInTransaction = 0;
        //    OneDollarCountInTransaction = 0;
        //    FiveDollarCountInTransaction = 0;
        //    TenDollarCountInTransaction = 0;
        //    TwentyDollarCountInTransaction = 0;
        //}

        public void BuySnack()
        {
            MoneyInside       += MoneyInTransaction;
            MoneyInTransaction = None;
        }
示例#4
0
        //public int OneCentCountInTransaction { get; private set; }
        //public int FiveCentCountInTransaction { get; private set; }
        //public int TenCentCountInTransaction { get; private set; }
        //public int QuarterCountInTransaction { get; private set; }
        //public int OneDollarCountInTransaction { get; private set; }
        //public int FiveDollarCountInTransaction { get; private set; }
        //public int TenDollarCountInTransaction { get; private set; }
        //public int TwentyDollarCountInTransaction { get; private set; }

        public void InsertMoney(Money02 money)
        {
            MoneyInTransaction += money;
        }