Example #1
0
        static bool TakeClients(GameBar gameBar)
        {
            string[] clientOrder = Console.ReadLine()
                                   .Split(new char[] { '-', ',', ' ' })
                                   .Where(p => !string.IsNullOrWhiteSpace(p))
                                   .ToArray();

            if (clientOrder[0] == "end")
            {
                return(false);
            }

            gameBar.AddClients(clientOrder);

            return(true);
        }
Example #2
0
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            GameBar gameBar = new GameBar();

            for (int i = 0; i < n; i++)
            {
                gameBar.AddProducts(TakeProduct());
            }

            while (TakeClients(gameBar))
            {
            }

            gameBar.PrintBill();
        }