public SweepStakes() { contestant = new Contestants(); name = ""; people = new Dictionary <int, Contestants>(); SweepstakeName(); }
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); }
//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; }
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(); }
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); }
void PrintContestantInfo(Contestants contestant) { }
public void PrintContestantInfo(Contestants contestant) { UserInterface.Winner(contestant); }
public void PickWinner() { Random random = new Random(); contestant = people[(random.Next(people.Count)) + 1]; }
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); }