static void Main(string[] args)
        {
            //create a new trick or treater
            var batman = new TrickOrTreater(new Person(13, "Ben", "Male"), "Batman");

            batman.AddCandy("Skittles");
            batman.AddCandy("Snickers");

            Console.WriteLine(batman.Costume + "'s bag has " + batman.Bag.CandyCount() + " pieces of candy in it");

            var smurf = new TrickOrTreater(new Person(11, "Alex", "Male"), "Papa Smurf");

            smurf.AddCandy("Nerds");
            smurf.AddCandy("Tootsie pop");
            smurf.AddCandy("3 Musketeers");

            Console.WriteLine(smurf.Costume + " is my costume this year.");
            Console.WriteLine("I only have " + smurf.Bag.CandyCount() + " pieces of candy!");

            smurf.AddCandy("Kitkat");
            smurf.AddCandy("Kitkat");
            smurf.AddCandy("Kitkat");
            smurf.AddCandy("Kitkat");
            smurf.AddCandy("Kitkat");
            smurf.AddCandy("Kitkat");
            smurf.AddCandy("Babe Ruth");

            Console.WriteLine("I have " + smurf.Bag.NumberOfCandyVarieties() + " types of candy.");

            var person = new Person(19, "Alaric", "MAN");



            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            //create a new trick or treater
            var batman = new TrickOrTreater("Ben", "Batman");

            batman.AddCandy("Skittles");
            batman.AddCandy("Snickers");

            Console.WriteLine(batman.Costume + "'s bag has " + batman.Bag.CandyCount() + " pieces of candy in it");

            var me = new TrickOrTreater("Jordan", "Bane");

            me.AddCandy("Reeses");
            me.AddCandy("Twix");
            me.AddCandy("Snickers");
            me.AddCandy("Starburst");

            Console.WriteLine(me.Costume + " is the costume I'm wearing.");
            Console.WriteLine("I have " + me.Bag.CandyCount() + " pieces of candy.");

            me.AddCandy("Twix");
            me.AddCandy("Snickers");
            me.AddCandy("Reeses");

            Console.WriteLine("I have " + me.Bag.NumberOfCandyVariety() + " types of candy.");



            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            //create a new trick or treater
            var batman = new TrickOrTreater("Ben", "Batman");
            batman.AddCandy("Skittles");
            batman.AddCandy("Snickers");

            Console.WriteLine(batman.Costume + "'s bag has " + batman.Bag.CandyCount() + " pieces of candy in it");

            Console.ReadKey();
        }
예제 #4
0
        static void Main(string[] args)
        {
            //create a new trick or treater
            var batman = new TrickOrTreater("Ben", "Batman");

            batman.AddCandy("Skittles");
            batman.AddCandy("Snickers");

            Console.WriteLine(batman.Costume + "'s bag has " + batman.Bag.CandyCount() + " pieces of candy in it");



            Console.ReadKey();
        }