示例#1
0
文件: Program.cs 项目: karppa1/Demo1
        static void Main(string[] args)
        {
            Wallet wallet = new Wallet();

            wallet.addMoney(5.5);
            wallet.addMoney(8.4);
            wallet.addMoney(7.9);

            Console.WriteLine(wallet.ToString());

            wallet.takeMoney(100);
            wallet.takeMoney(3.6);

            Console.WriteLine(wallet.ToString());

            wallet.addCard(new Card("S-Etukortti", "Aku Ankka", "ABC12345"));
            wallet.addCard(new Card("Visa", "Aku Ankka", "CBA12345"));
            wallet.addCard(new Card("Kirjastokortti", "Aku Ankka", "ACB12345"));

            Console.WriteLine(wallet.ToString());

            wallet.takeCard("Visa");

            Console.WriteLine(wallet.ToString());

            Console.ReadLine();
        }
示例#2
0
        static void Main(string[] args)
        {
            Wallet w = new Wallet();

            w.Add(50.50);
            w.Add(12.30);
            w.Add(8);

            //Card master = new Card("Mastercard", "Jani Immonen", "never");

            //w.Add(master);
            w.Add(new Card("Mastercard", "Jani Immonen", "never"));
            w.Add(new Card("Kirjastokortti", "Jani Immonen", "never"));
            w.Add(new Card("Firman kortti", "Jani Immonen", "12/19"));

            Console.WriteLine(w.ToString());

            //w.Take(master);
            w.Take("Mastercard");
            w.Take(14.10);

            Console.WriteLine(w.ToString());
            Console.ReadLine();
        }