Пример #1
0
        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);
        }
Пример #2
0
        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;
                }
            }
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
            }
        }
Пример #5
0
 public void PrintContestantInfo(Contestant contestant)
 {
     Console.WriteLine($"The contestant's info is:\n {contestant.firstName}\n{contestant.lastName}\n{contestant.email}\n{contestant.registrationNumber}");
 }
Пример #6
0
 public void PrintContestantInfo(Contestant contestant)
 {
     UserInterface.DisplayText("Name: " + contestant.firstName + " " + contestant.lastName);
     UserInterface.DisplayText("Email: " + contestant.emailAddress);
     UserInterface.DisplayText("Registration number: " + contestant.registrationNumber);
 }
Пример #7
0
 public static void DisplayContestant(Contestant contestant)
 {
     Console.WriteLine($"Name: {contestant.FullName}\nEmail: {contestant.Email}\nRegistration Number: {contestant.RegistrationNumber}\nWinner: {(contestant.IsWinner ? "Yes" : "No")}");
 }
Пример #8
0
 //member methods
 public void RegisterContestant(Contestant contestant)
 {
     contestant.ContestantInfo();
     contestantList.Add(contestant.registrationNumber, contestant);
 }
Пример #9
0
 //Methods
 public void RegisterContestant(Contestant contestant)
 {
     dictionarynumber++;
     contestants.Add(dictionarynumber, contestant);
 }
Пример #10
0
 public void PrintContestantInfo(Contestant contestant)
 {
     Contestant = String.Format("Firstname: [0], Lastname: [1], Email:[2], Registration:[3])");
 }
Пример #11
0
 public static void DisplayContestantInformation(Contestant contestant)
 {
     Console.WriteLine(contestant.firstName + " " + contestant.lastName);
     Console.WriteLine(contestant.email);
     Console.WriteLine("Registration number: " + contestant.registrationNumber);
 }
Пример #12
0
 public void RegisterContestant(Contestant contestant)
 {
     registeredContestants.Add(contestant.registrationNumber, contestant);
 }
Пример #13
0
        public void PrintContestantInfo(Contestant contestant)
        {
            string theWinner = PickWinner();

            Console.WriteLine(theWinner);
        }
Пример #14
0
 public void RegisterContestant(Contestant contestant)
 {
     contestant.registrationNumber = registrationNumber;
     contestants.Add(contestant.registrationNumber, contestant);
     registrationNumber++;
 }
Пример #15
0
 //member methods
 public void RegisterContestant(Contestant contestant)
 {
     contestant.RegistrationNumber = contestants.Count + 1;
     contestants.Add(contestant.RegistrationNumber, contestant);
     potentialWinnerPool++;
 }
Пример #16
0
 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);
 }
Пример #17
0
 public void printContestantInfo(Contestant c)
 {
     Console.WriteLine($"Name: {c.firstName} {c.lastName}\nEmail{c.email}");
 }
Пример #18
0
 public void PrintContestantInfo(Contestant contestant)
 {
 }
Пример #19
0
 public void RegisterContestant(Contestant contestant)
 {
 }
Пример #20
0
 public void RegisterContestant(Contestant contestant)
 {
     contestant.registrationNumber = registrationID;
     contestants.Add(registrationID, contestant);
     registrationID++;
 }
Пример #21
0
 public void PrintContestantInformation(Contestant contestant)
 {
     UserInterface.DisplayMessage($"Contestant information: \n Name: {contestant.FirstName} {contestant.LastName} \n Email: {contestant.EmailAddress}, \n Contestant ID: {contestant.RegistrationNumber}.");
 }
Пример #22
0
 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);
 }
Пример #23
0
        public Contestant CreateContestant()
        {
            Contestant newContestant = new Contestant();

            return(newContestant);
        }
Пример #24
0
 public void PrintContestantInfo(Contestant contestant)
 {
     Console.WriteLine(contestant.firstName, contestant.lastName);
     Console.WriteLine(contestant.email, contestant.registration);
 }
Пример #25
0
 public void RegisterContestant(Contestant contestant)
 {
     contestants.Add(contestant);
 }
Пример #26
0
 public void RegisterContestant(Contestant contestant)
 {
     Contestants.Add(contestant.regnumber, contestant.name);
 }
Пример #27
0
 public static void GetContestantInformation(Contestant contestant)
 {
     contestant.firstName = GetFirstName();
     contestant.lastName  = GetLastName();
     contestant.email     = GetEmail();
 }
Пример #28
0
 //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++;
 }
Пример #29
0
 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}");
 }