コード例 #1
0
        static void Main(string[] args)
        {
            string      name        = "mike";
            Sweepstakes sweepstakes = new Sweepstakes(name);
            Contestant  contestant  = new Contestant();

            contestant.emailAddress = "*****@*****.**";
            contestant.firstName    = "Mike";
            contestant.lastName     = "Jordan";
            sweepstakes.RegisterContestant(contestant);
            Contestant contestant1 = new Contestant();

            contestant1.emailAddress = "*****@*****.**";
            contestant1.firstName    = "PaHoua";
            contestant1.lastName     = "Lee";
            sweepstakes.RegisterContestant(contestant1);
            Contestant contestant2 = new Contestant();

            contestant2.emailAddress = "*****@*****.**";
            contestant2.firstName    = "Mai";
            contestant2.lastName     = "Chang";
            sweepstakes.RegisterContestant(contestant2);

            string winner = sweepstakes.PickWinner();

            Console.WriteLine("1st " + winner);
            winner = sweepstakes.PickWinner();
            Console.WriteLine("2nd " + winner);
            winner = sweepstakes.PickWinner();
            Console.WriteLine("3rd " + winner);

            sweepstakes.PrintContestantInfo(contestant);
            sweepstakes.PrintContestantInfo(contestant1);
            sweepstakes.PrintContestantInfo(contestant2);


            sweepstakes.NotifyEachContestants();
            sweepstakes.NotifyWinnerEmail(contestant);

            Console.ReadLine();

            Contestant contestant3 = new Contestant();

            contestant3.firstName = UserInterface.FirstName();
            Console.ReadLine();
            contestant3.lastName = UserInterface.LastName();
            Console.ReadLine();
            contestant3.emailAddress = UserInterface.EmailAddress();
            Console.ReadLine();

            UserInterface.DisplayConstestantInfo(contestant3);

            string user = UserInterface.PickSweepstakesTypeManager(); //variable to store input of manager type

            Console.ReadLine();
        }