Exemple #1
0
        public void TakeMoney(Bill bill)
        {
            if (!Bill.Validate(bill))
            {
                Console.WriteLine("The bill {0} is not valid! Unacceptablle!!!", (int)bill);
                return;
            }

            if (bills.ContainsKey(bill))
            {
                bills[bill]++;
            }
            else
            {
                bills.Add(bill, 1);
            }

            total += bill.Value;
        }