Exemplo n.º 1
0
        static void HeadOfLine(Queue male, Queue female)
        {
            Dancer w, m;

            m = new Dancer();
            w = new Dancer();
            if (male.Count > 0)
            {
                m.GetName(male.Peek().ToString());
            }
            if (female.Count > 0)
            {
                w.GetName(female.Peek().ToString());
            }
            if (m.name != " " && w.name != "")
            {
                Console.WriteLine("Next in line are: " + m.name + "\t" + w.name);
            }
            else if (m.name != "")
            {
                Console.WriteLine("Next in line is: " + m.name);
            }
            else
            {
                Console.WriteLine("Next in line is: " + w.name);
            }
        }
Exemplo n.º 2
0
        static void StartDancing(Queue male, Queue female)
        {
            Dancer m, w;

            m = new Dancer();
            w = new Dancer();
            Console.WriteLine("Dance partners are: ");
            Console.WriteLine();
            for (int i = 0; i <= 3; i++)
            {
                m.GetName(male.Dequeue().ToString());
                w.GetName(female.Dequeue().ToString());
                Console.WriteLine(w.name + "\t" + m.name);
            }
        }
Exemplo n.º 3
0
        static void NewDancers(Queue male, Queue female)
        {
            Dancer m, w;

            m = new Dancer();
            w = new Dancer();
            if (male.Count > 0 && female.Count > 0)
            {
                m.GetName(male.Dequeue().ToString());
                w.GetName(female.Dequeue().ToString());
            }
            else if ((male.Count > 0) && (female.Count == 0))
            {
                Console.WriteLine("Waiting on a female dancer.");
            }
            else if ((female.Count > 0) && (male.Count == 0))
            {
                Console.WriteLine("Waiting on a male dancer.");
            }
        }