public string PickWinner() { pickWinningNumber(); Contestant winner = null; for (int i = 0; i < sweeps.Count; i++) { if (sweeps[i].ticketNumber == winningNumber) { winner = sweeps[i]; sweeps[i].result = ("Winner!"); } else { sweeps[i].result = ("Loser"); } } Console.WriteLine("The winner is " + winner.firstName + " " + winner.lastName); runMenu(); return(winner.firstName + winner.lastName); }
public void RegisterContestant(Contestant contestant) { sweeps.Add(contestant.ticketNumber, contestant); }
public void PrintContestantInfo(Contestant contestant) { Console.WriteLine("Contestent Name : {0}", contestant.firstName + "" + contestant.lastName); Console.WriteLine("Contestent ticket number : {0}", contestant.ticketNumber); Console.WriteLine("You {0}", contestant.result); }