public void PreregisteredContestants() { contestantDictionary = new Dictionary <string, int>(); Contestant khiera = new Contestant("Khiera", 21, 3); Contestant gwen = new Contestant("Gwen", 49, 4); Contestant sam = new Contestant("Sam", 52, 5); Contestant jasmine = new Contestant("Jasmine", 23, 6); contestantDictionary.Add("Khiera", 3); contestantDictionary.Add("Gwen", 4); contestantDictionary.Add("Sam", 5); contestantDictionary.Add("Jasmine", 6); contestantList.Add(khiera); contestantList.Add(gwen); contestantList.Add(sam); contestantList.Add(jasmine); }
public void registerContestant(Contestant c) { Random rnd = new Random(); //preventing collisions of registration Num while (true) { try { c.register(rnd.Next(100000, 999999)); contestants.Add(c.registration, c); registrationNumbers.Add(c.registration); break; } catch (Exception E) { continue; } } }
public Contestant GetInformation() { Contestant newContestant = new Contestant(); Console.WriteLine("Please enter first name."); newContestant.FirstName = Console.ReadLine(); Console.WriteLine("Please enter last name."); newContestant.LastName = Console.ReadLine(); Console.WriteLine("Please enter email."); newContestant.EmailAddress = Console.ReadLine(); Console.WriteLine("Please enter a registrant number."); newContestant.RegistNumber = Convert.ToInt32(Console.ReadLine()); return(newContestant); }
public void ConfirmInformation(Contestant contestant, int RegistrationNumber) { Console.Clear(); Console.WriteLine("Is the below information correct? Please type 'yes' or 'no'"); Console.WriteLine($"First name: {contestant.FirstName} \nLast name: {contestant.LastName} \nEmail address: {contestant.EmailAddress}"); string choice = Console.ReadLine().ToLower(); if (choice == "yes") { Console.Clear(); Console.WriteLine("Contestant added!"); Console.ReadKey(); return; } else if (choice == "no") { GetContestantInformation(contestant, RegistrationNumber); } else { Console.WriteLine("Please enter a valid input"); ConfirmInformation(contestant, RegistrationNumber); } }
public void PrintContestantInfo(Contestant contestant) { Console.WriteLine($"The contestant's info is:\n {contestant.firstName}\n{contestant.lastName}\n{contestant.email}\n{contestant.registrationNumber}"); }
public void PrintContestantInfo(Contestant contestant) { UserInterface.DisplayText("Name: " + contestant.firstName + " " + contestant.lastName); UserInterface.DisplayText("Email: " + contestant.emailAddress); UserInterface.DisplayText("Registration number: " + contestant.registrationNumber); }
public static void DisplayContestant(Contestant contestant) { Console.WriteLine($"Name: {contestant.FullName}\nEmail: {contestant.Email}\nRegistration Number: {contestant.RegistrationNumber}\nWinner: {(contestant.IsWinner ? "Yes" : "No")}"); }
//member methods public void RegisterContestant(Contestant contestant) { contestant.ContestantInfo(); contestantList.Add(contestant.registrationNumber, contestant); }
//Methods public void RegisterContestant(Contestant contestant) { dictionarynumber++; contestants.Add(dictionarynumber, contestant); }
public void PrintContestantInfo(Contestant contestant) { Contestant = String.Format("Firstname: [0], Lastname: [1], Email:[2], Registration:[3])"); }
public static void DisplayContestantInformation(Contestant contestant) { Console.WriteLine(contestant.firstName + " " + contestant.lastName); Console.WriteLine(contestant.email); Console.WriteLine("Registration number: " + contestant.registrationNumber); }
public void RegisterContestant(Contestant contestant) { registeredContestants.Add(contestant.registrationNumber, contestant); }
public void PrintContestantInfo(Contestant contestant) { string theWinner = PickWinner(); Console.WriteLine(theWinner); }
public void RegisterContestant(Contestant contestant) { contestant.registrationNumber = registrationNumber; contestants.Add(contestant.registrationNumber, contestant); registrationNumber++; }
//member methods public void RegisterContestant(Contestant contestant) { contestant.RegistrationNumber = contestants.Count + 1; contestants.Add(contestant.RegistrationNumber, contestant); potentialWinnerPool++; }
void PrintContestantInfo(Contestant contestant) { Console.WriteLine($"First Name: {1}, Last Name: {2}, Email: {3}, reg number: {4},", contestant.firstName, contestant.lastName, contestant.email, contestant.regerstrationNumber); }
public void printContestantInfo(Contestant c) { Console.WriteLine($"Name: {c.firstName} {c.lastName}\nEmail{c.email}"); }
public void PrintContestantInfo(Contestant contestant) { }
public void RegisterContestant(Contestant contestant) { }
public void RegisterContestant(Contestant contestant) { contestant.registrationNumber = registrationID; contestants.Add(registrationID, contestant); registrationID++; }
public void PrintContestantInformation(Contestant contestant) { UserInterface.DisplayMessage($"Contestant information: \n Name: {contestant.FirstName} {contestant.LastName} \n Email: {contestant.EmailAddress}, \n Contestant ID: {contestant.RegistrationNumber}."); }
public void RegisterContestant(Contestant contestant) // where this is called, must create contestant obj { contestant.RegistrationNumber = _RegistrationNumber; // RegNum generated in this class sSDictionary.Add(contestant.RegistrationNumber, contestant); }
public Contestant CreateContestant() { Contestant newContestant = new Contestant(); return(newContestant); }
public void PrintContestantInfo(Contestant contestant) { Console.WriteLine(contestant.firstName, contestant.lastName); Console.WriteLine(contestant.email, contestant.registration); }
public void RegisterContestant(Contestant contestant) { contestants.Add(contestant); }
public void RegisterContestant(Contestant contestant) { Contestants.Add(contestant.regnumber, contestant.name); }
public static void GetContestantInformation(Contestant contestant) { contestant.firstName = GetFirstName(); contestant.lastName = GetLastName(); contestant.email = GetEmail(); }
//Member Methods (CAN DO) public void RegisterContestant(Contestant contestant) { contestants.Add(counter, contestant); //Is executing method twice--> in creating new Cont. and Adding to Dictionary **CHANGE** counter++; }
public void RegisterContestant(Contestant contestant) { contestant.CreateContestant(); contestInfo.Add(contestant.registrationNumber, contestant); }
public void PrintContestantInfo(Contestant winner) { //winners info Console.WriteLine("Congratulations to the Winner!\n\n"); Console.WriteLine($"The Winner is {winner.firstName} {winner.lastName} registration number {winner.registrationNumber}"); }