Ejemplo n.º 1
0
        //member methods
        public void RunSimulation()
        {
            string userInput;

            CreateMarketingFirmWithManager();
            do
            {
                userInput = UserInterface.DisplayMenu("What would you like to do?\n\na) Create Sweepstake\nb) Pick Winner\nc) Add contestant\nd) Quit");
                if (Comparer <string> .Default.Compare(userInput, "a") == 0)
                {
                    marketingFirm.CreateSweepstake();
                }
                if (Comparer <string> .Default.Compare(userInput, "b") == 0)
                {
                    marketingFirm.PickAWinner(rng);
                }
                if (Comparer <string> .Default.Compare(userInput, "c") == 0)
                {
                    marketingFirm.RegisterAContestant(rng);
                }
            } while (Comparer <string> .Default.Compare(userInput, "d") != 0);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Simulation    simulation       = new Simulation();
            MarketingFirm marketingFirmOne = simulation.CreateMarketingFirmWithManager();
            //Sweepstakes winCruise = marketingFirmOne.CreateSweepstake();
            Sweepstakes winNewHouse = marketingFirmOne.CreateSweepstake();

            //marketingFirmOne.Manager.InsertSweepstakes(winCruise);
            marketingFirmOne.Manager.InsertSweepstakes(winNewHouse);
            //winCruise.RegisterContestant();
            winNewHouse.RegisterContestant();
            //winCruise.RegisterContestant();
            winNewHouse.RegisterContestant();
            //winNewHouse.RegisterContestant();
            //winNewHouse.RegisterContestant();
            //Contestant winner = winCruise.PickWinner();
            //Contestant otherWinner = winNewHouse.PickWinner();
            //Console.WriteLine(winner.registrationNumber);
            winNewHouse.Notify();


            Console.ReadLine();
        }