Example #1
0
 public SweepStakes()
 {
     contestant = new Contestants();
     name       = "";
     people     = new Dictionary <int, Contestants>();
     SweepstakeName();
 }
Example #2
0
 void RegisterContestant(Contestants contestant)
 {
     contestant.ContestantInfo();
     contestant.registrationnumber = counter;
     ContestantsList.Add(counter, contestant);
     counter++;
 }
        public Contestants PickWinner()
        {
            int         random            = new Random().Next(1, ContestantCount);
            Contestants winningContestant = newContestants[random];

            return(winningContestant);
        }
Example #4
0
        //constructor
        public Contestants(string firstname, string lastname)
        {
            Contestants contestant = new Contestants(firstname, lastname);

            this.firstName          = firstName;
            this.lastName           = lastName;
            this.emailAddress       = emailAddress;
            this.registrationNumber = registrationNumber;
        }
Example #5
0
        static void Main(string[] args)
        {
            Contestants contestant = new Contestants();
            SweepStakes SS         = new SweepStakes();

            SS.RegisterContestant(contestant);
            SS.RegisterContestant(contestant);
            SS.RegisterContestant(contestant);
            SS.PickWinner();
            SS.PrintContestantInfo(contestant);
            Console.WriteLine();
        }
Example #6
0
        public void RegisterContestant(Contestants contestant)
        {
            int reg;

            contestant.Firstname = UserInterface.FirstName();
            contestant.Lastname  = UserInterface.LastName();
            contestant.Email     = UserInterface.eMail();
            contestant.Regnumber = (people.Count + 1);
            reg = contestant.Regnumber;
            UserInterface.RegisterNumber(reg);
            people.Add(contestant.Regnumber, contestant);
        }
Example #7
0
 void PrintContestantInfo(Contestants contestant)
 {
 }
Example #8
0
 public void PrintContestantInfo(Contestants contestant)
 {
     UserInterface.Winner(contestant);
 }
Example #9
0
        public void PickWinner()
        {
            Random random = new Random();

            contestant = people[(random.Next(people.Count)) + 1];
        }
Example #10
0
 public static void Winner(Contestants contestant)
 {
     Console.WriteLine("Winner: " + contestant.Firstname + " " + contestant.Lastname + "\n" +
                       "Email: " + contestant.Email + "\n" +
                       "Registration Number: " + contestant.Regnumber);
 }
 public void PrintContestantInfo(Contestants contestants)
 {
     Console.WriteLine(winningContestant.firstName + winningContestant.lastName);
     Console.WriteLine(winningContestant.emailAddress);
     Console.WriteLine(winningContestant.registrationNumber);
 }
        // Member Method

        public void RegisterContestant(Contestants contestants)
        {
            ContestantCount++;
            newContestants.Add(ContestantCount, contestants);
        }