Exemple #1
0
        static void Main(string[] args)
        {
            Buffet     spread   = new Buffet();
            SpiceHound michelle = new SpiceHound();
            SweetTooth mark     = new SweetTooth();

            while (michelle.IsFull == false)
            {
                Console.WriteLine("Michelle ate/drank the following item: ");
                michelle.Consume(spread.Serve());
            }
            while (mark.IsFull == false)
            {
                Console.WriteLine("Mark ate/drank the following item: ");
                mark.Consume(spread.Serve());
            }
            if (mark.ConsumptionHistory.Count > michelle.ConsumptionHistory.Count)
            {
                Console.WriteLine($"Mark ate the most and he ate/drank {mark.ConsumptionHistory.Count} items.");
            }
            if (michelle.ConsumptionHistory.Count > mark.ConsumptionHistory.Count)
            {
                Console.WriteLine($"Michelle ate the most and she ate/drank {michelle.ConsumptionHistory.Count} items.");
            }
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Food   steak  = new Food("steak", 1000, true, false);
            Drink  pepsi  = new Drink("PEPSI", 120, false, true);
            Buffet buffet = new Buffet();

            buffet.Menu.Add(steak);
            buffet.Menu.Add(pepsi);

            SpicyHound ninjaHot   = new SpicyHound();
            SweetTooth ninjaSweet = new SweetTooth();

            while (!ninjaHot.IsFull)
            {
                ninjaHot.Consume(buffet.Serve());
            }
            while (!ninjaSweet.IsFull)
            {
                ninjaSweet.Consume(buffet.Serve());
            }

            int total = ninjaHot.ConsumptionHistory.Count + ninjaSweet.ConsumptionHistory.Count;

            // most consumed items of each ninja
            string mostItemSpicyHound = mostConsume(ninjaHot.ConsumptionHistory);

            Console.WriteLine($"NinjaHot consumed {mostItemSpicyHound} most!");
            Console.WriteLine(" ");
            string mostItemSweetTooth = mostConsume(ninjaSweet.ConsumptionHistory);

            Console.WriteLine($"NinjaSweet consumed {mostItemSweetTooth} most!");
            Console.WriteLine(" ");
        }
Exemple #3
0
        static void Main(string[] args)
        {
            Buffet      menu = new Buffet();
            IConsumable x    = menu.Serve();
            IConsumable y    = menu.Serve();
            IConsumable z    = menu.Serve();
            SpiceHound  rick = new SpiceHound();
            SweetTooth  dave = new SweetTooth();

            dave.Consume(x);
            dave.Consume(x);
            rick.Consume(x);
            rick.Consume(y);
            rick.Consume(z);
            Console.WriteLine(rick.ConsumptionHistory.Count);
            Console.WriteLine(dave.ConsumptionHistory.Count);
            if (rick.ConsumptionHistory.Count > dave.ConsumptionHistory.Count)
            {
                Console.WriteLine("Rick ate more thangs");
            }
            else
            {
                Console.WriteLine("Dave is the man i guess");
            }
        }
Exemple #4
0
        static void Main(string[] args)
        {
            SweetTooth sweetie = new SweetTooth();
            SpiceHound spicy   = new SpiceHound();
            Buffet     buffet  = new Buffet();

            sweetie.Consume(buffet.Serve());
            sweetie.Consume(buffet.Serve());
            sweetie.Consume(buffet.Serve());
            sweetie.Consume(buffet.Serve());
            sweetie.Consume(buffet.Serve());

            spicy.Consume(buffet.Serve());
            spicy.Consume(buffet.Serve());
            spicy.Consume(buffet.Serve());
            spicy.Consume(buffet.Serve());
            spicy.Consume(buffet.Serve());

            if (sweetie.ConsumptionHistory.Count > spicy.ConsumptionHistory.Count)
            {
                Console.WriteLine($"Sweetie cosumed the most items! She ate {sweetie.ConsumptionHistory.Count} items!");
            }
            else if (sweetie.ConsumptionHistory.Count < spicy.ConsumptionHistory.Count)
            {
                Console.WriteLine($"Spicy cosumed the most items! He ate {spicy.ConsumptionHistory.Count} items!");
            }
            else
            {
                Console.WriteLine("Sweetie and Spicy ate the same number of items!");
            }
        }
Exemple #5
0
        static void Main(string[] args)
        {
            Buffet     World = new Buffet();
            SweetTooth sweet = new SweetTooth();
            SpiceHound spice = new SpiceHound();

            while (sweet.IsFull == false)
            {
                sweet.Consume(World.Serve());
            }
            while (spice.IsFull == false)
            {
                spice.Consume(World.Serve());
            }
        }
Exemple #6
0
        static void Main(string[] args)
        {
            Buffet buff1 = new Buffet();

            SweetTooth sw = new SweetTooth();

            while (sw.IsFull == false)
            {
                sw.Consume(buff1.Serve());
            }
            System.Console.WriteLine("SweetTooth's food history: ");
            Console.WriteLine("{0,-25} {1,5}\n", "Food Name", "Food Calories");
            foreach (var food in sw.ConsumptionHistory)
            {
                System.Console.WriteLine("{0,-25} {1,5:N0}", food.Name, food.Calories);
            }

            System.Console.WriteLine($"Sweet Tooth ate {sw.CalorieAmount} calories. Ninja is too full to eat anymore.");


            System.Console.WriteLine("----------------------------------------------------------------");

            SpiceHound sp = new SpiceHound();

            while (!sp.IsFull)
            {
                sp.Consume(buff1.Serve());
            }

            System.Console.WriteLine("Spicehound's food history: ");
            Console.WriteLine("{0,-25} {1,5}\n", "Food Name", "Food Calories");
            foreach (var food in sp.ConsumptionHistory)
            {
                System.Console.WriteLine("{0,-25} {1,5:N0}", food.Name, food.Calories);
            }

            System.Console.WriteLine($"Spice Hound ate {sp.CalorieAmount} calories. Ninja is too full to eat anymore.");

            System.Console.WriteLine("----------------------------------------------------------------");

            System.Console.WriteLine($"Sweet Tooth consumed {sw.ConsumptionHistory.Count} items. Spice Hound consumed {sp.ConsumptionHistory.Count} items");

            string winner = (sw.ConsumptionHistory.Count > sp.ConsumptionHistory.Count) ? "Sweet Tooth" : (sw.ConsumptionHistory.Count == sp.ConsumptionHistory.Count)? "Nobody" :"Spice Hound";

            System.Console.WriteLine($"{winner} ate the most items!");
        }
Exemple #7
0
        static void Main(string[] args)
        {
            Buffet     buff    = new Buffet();
            SpiceHound noah    = new SpiceHound();
            SweetTooth Kristen = new SweetTooth();

            // Console.WriteLine(buff.Serve().Name);

            while (!noah.IsFull)
            {
                noah.Consume(buff.Serve());
            }
            noah.Consume(buff.Serve());

            while (!Kristen.IsFull)
            {
                Kristen.Consume(buff.Serve());
            }
            Kristen.Consume(buff.Serve());
        }
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            Buffet     nomnoms = new Buffet();
            SpiceHound ghost   = new SpiceHound();
            SweetTooth lady    = new SweetTooth();

            ghost.Consume(nomnoms.Serve("Sake"));
            ghost.Consume(nomnoms.Serve("Sake"));
            ghost.Consume(nomnoms.Serve("Sake"));
            ghost.Consume(nomnoms.Serve("Sake"));
            ghost.Consume(nomnoms.Serve("Pork Buns"));
            ghost.Consume(nomnoms.Serve("Sake"));
            System.Console.WriteLine(ghost.IsFull);
            ghost.FoodDiary();
            lady.Consume(nomnoms.Serve("Pork Buns"));
            lady.Consume(nomnoms.Serve("Pork Buns"));
            lady.FoodDiary();
            System.Console.WriteLine(lady.IsFull);
        }
Exemple #9
0
        static void Main(string[] args)
        {
            Buffet buffet = new Buffet();

            SweetTooth sweet1 = new SweetTooth("Anne");

            ConsoleYellow($"{sweet1.Name} is eating at the buffet");
            while (!sweet1.IsFull)
            {
                sweet1.Consume(buffet.Serve());
            }
            sweet1.Consume(buffet.Serve());

            SpiceHound spice1 = new SpiceHound("David");

            ConsoleYellow($"{spice1.Name} is eating at the buffet");
            while (!spice1.IsFull)
            {
                spice1.Consume(buffet.Serve());
            }
            spice1.Consume(buffet.Serve());

            ConsoleYellow($"{sweet1.Name}'s total items consumed: {sweet1.ConsumptionHistory.Count}");
            ConsoleYellow($"{spice1.Name}'s total items consumed: {spice1.ConsumptionHistory.Count}");

            if (sweet1.ConsumptionHistory.Count > spice1.ConsumptionHistory.Count)
            {
                ConsoleRed($"**********************************AND THE EATING COMPETITION GOES TO {sweet1.Name} with {sweet1.ConsumptionHistory.Count} items consumed!");
            }
            else if (spice1.ConsumptionHistory.Count > sweet1.ConsumptionHistory.Count)
            {
                ConsoleRed($"**********************************AND THE EATING COMPETITION GOES TO {spice1.Name} with {spice1.ConsumptionHistory.Count} items consumed!");
            }
            else
            {
                ConsoleRed($"**********************************AND THE EATING COMPETITION GOES TO NOBODY...IT'S A TIE!!!");
            }
        }
Exemple #10
0
        static void Main(string[] args)
        {
            Buffet mixed = new Buffet();

            SweetTooth Aiden = new SweetTooth();
            SpiceHound Aaron = new SpiceHound();

            Aiden.Consume(mixed.Serve());
            Aiden.Consume(mixed.Serve());
            Aiden.Consume(mixed.Serve());
            Aiden.Consume(mixed.Serve());


            Aaron.Consume(mixed.Serve());
            Aaron.Consume(mixed.Serve());

            int count1 = Aaron.ConsumptionHistory.Count;
            int count2 = Aiden.ConsumptionHistory.Count;

            if (count1 > count2)
            {
                System.Console.WriteLine(Aaron + "Consumed more than " + Aiden + "!");
                System.Console.WriteLine("Aaron consumed" + count1);
            }
            else if (count1 == count2)
            {
                System.Console.WriteLine("Both " + Aaron + " and " + Aiden + " consumed the same amount!");
                System.Console.WriteLine(Aiden + " consumed " + count2);
                System.Console.WriteLine("Aaron consumed" + count1);
            }
            else if (count1 < count2)
            {
                System.Console.WriteLine(Aiden + "Consumed more than " + Aaron + "!");
                System.Console.WriteLine(Aiden + " consumed " + count2);
            }
        }