Beispiel #1
0
        public void CreateSweepstake()
        {
            Sweepstakes sweepstake          = new Sweepstakes(UserInterface.NameSweepstake());
            int         numberOfContestants = UserInterface.NumberOf("contestants");

            for (int i = 0; i < numberOfContestants; i++)
            {
                sweepstake.RegisterContestant(new Contestant());
            }
            manager.InsertSweepstakes(sweepstake);
            sweepstake.PrintContestantInfo(sweepstake.PickWinner());
            sweepstake.Notify();
        }
        static void Main(string[] args)
        {
            Sweepstakes sweepstakes = new Sweepstakes("powerball");



            sweepstakes.RegisterContestant(new Contestant("david", "steinhafel", "*****@*****.**", 445));
            sweepstakes.RegisterContestant(new Contestant("charlie", "sather", "*****@*****.**", 446));



            sweepstakes.Notify(sweepstakes.PickWinner());
            Console.ReadLine();
        }