Пример #1
0
        public static void Main(string[] args)
        {
            Console.WriteLine("The workers coming out,and sit on the branch");
            Console.WriteLine("They are eating their lunch:tomatoes,joghurt bread,and some sausages.");
            Console.WriteLine("Oh wait one of the tomatoes is rotten,the worker spot a dustbin and said this:'look at this guys a 360 noscope'");
            Dustbin Dustbin = new Dustbin("red");

            Console.WriteLine(",but he failed the throw so the rotten tomato fall beside the dustbin.");
            Garbage rottenTomatoe = new Garbage("rottentomato");

            Console.WriteLine("After then the workers finished their lunch,but because they are uncultured swines");
            Console.WriteLine("They throw the trash onto the ground.");
            PlasticGarbage joghurt     = new PlasticGarbage("joghurt", false);
            PlasticGarbage sausageWrap = new PlasticGarbage("sausagewrap", true);

            Console.WriteLine("One of the workers lit a cigar,and as this was the last cigar in the box,he threw also the cigar box onto the ground");
            PaperGarbage cigarBox = new PaperGarbage("cigarbox", false);

            Console.WriteLine("After this they go back to work,and the cleaning ladies are coming");
            Console.WriteLine("As soon as they see the mess,they say a loud f**k!");
            Console.WriteLine("One of the ladies pick up the rotten tomatoes and throw in the Dustbin");
            Dustbin.ThrowOutGarbage(rottenTomatoe);
            Console.WriteLine("They pick up the joghurt and clean it");
            joghurt.Clean();
            Console.WriteLine("After then they throw into the dustbin and also the sausages wrap");
            Dustbin.ThrowOutGarbage(joghurt);
            Dustbin.ThrowOutGarbage(sausageWrap);
            Console.WriteLine("They spot the cigarbox also,so they squeezed it and throw out");
            cigarBox.Squeeze();
            Dustbin.ThrowOutGarbage(cigarBox);
            Console.WriteLine("Now the Dustbin's content are: ");
            Dustbin.DisplayContents();
        }
Пример #2
0
        public static void Main(string[] args)
        {
            Garbage[] rottenTomatoes = new Garbage[3];
            for (int i = 0; i < rottenTomatoes.Length; i++)
            {
                rottenTomatoes[i] = new Garbage("rotten tomato nr." + (i + 1));
            }

            PlasticGarbage milkJug = new PlasticGarbage("plastic milk jug", true);

            PaperGarbage nemzetiSport = new PaperGarbage("Nemzeti Sport", true);

            Dustbin dustbin = new Dustbin("Jenny's handsome");


            Console.WriteLine("1. ROUND:");
            dustbin.DisplayContents();
            dustbin.ThrowOutGarbage(milkJug);
            dustbin.ThrowOutGarbage(nemzetiSport);
            for (int i = 0; i < rottenTomatoes.Length; i++)
            {
                dustbin.ThrowOutGarbage(rottenTomatoes[i]);
            }
            Console.WriteLine("---------------------------");
            Console.WriteLine("2. ROUND:");
            dustbin.DisplayContents();
            dustbin.EmptyContents();
            Console.WriteLine("---------------------------");
            Console.WriteLine("3. ROUND:");
            dustbin.DisplayContents();
        }
Пример #3
0
        public static void Main(string[] args)
        {
            PaperGarbage paperbox   = new PaperGarbage("paperbox", false);
            Dustbin      redDustBin = new Dustbin("Red");

            Console.WriteLine(redDustBin.Color);
            Console.ReadLine();
        }