Esempio n. 1
0
        static void Main(string[] args)
        {
            ISweepstakesManager manager = SweepstakeManagerFactory.ChooseStackOrQueue();

            Sweepstakes sweepstake = new Sweepstakes(" Fortnite battlepass!");

            Contestant contestant = new Contestant();

            contestant.SetFirstName("Uma");
            contestant.SetLastName("Bob");
            contestant.SetEmailAdress("*****@*****.**");

            sweepstake.RegisterContestant(contestant);

            Contestant contestant2 = new Contestant();

            contestant2.SetFirstName("Billy");
            contestant2.SetLastName("Bob");
            contestant2.SetEmailAdress("*****@*****.**");

            sweepstake.RegisterContestant(contestant2);

            manager.InsertSweepstakes(sweepstake);

            MarketingFirm firm = new MarketingFirm(manager);

            Console.WriteLine(manager.GetSweepstakes().PickWinner());
            Console.ReadLine();
        }
        public Sweepstakes CreateContestant(Sweepstakes sweepstakes)
        {
            //UNCOMMENT TO AUTOMATE THIS PROCESS
            //for (int i = 0; i < 100; i++)
            for (int i = 0; i < 3; i++)
            {
                //string tempFirstName = "Contestant";
                //string tempLastName = i.ToString();
                //string tempEmail = tempFirstName + "." + tempLastName + "@email.com";

                string tempFirstName = UserInterface.GetContestantFirstName();
                string tempLastName  = UserInterface.GetContestantLastName();
                string tempEmail     = UserInterface.GetContestantEmail();

                int tempRegNum = GenerateRegistrationNumber(random);

                Contestant tempContestant = new Contestant(tempFirstName, tempLastName, tempEmail, tempRegNum);
                try
                {
                    sweepstakes.RegisterContestant(tempContestant);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                    tempContestant.registrationNumber = GenerateRegistrationNumber(random);
                    sweepstakes.RegisterContestant(tempContestant);
                }
            }
            return(sweepstakes);
        }
Esempio n. 3
0
        // member methods

        public void RunMain()
        {
            sweepstakes1 = new Sweepstakes("Chachie");                                  //fix later for random number getting deleted. Gets program working right now.
            contestant1  = new Contestant("Jack", "Sparrow", "*****@*****.**", sweepstakes1.GetRandomNumber(50));
            contestant2  = new Contestant("Steve", "Rogers", "*****@*****.**", sweepstakes1.GetRandomNumber(50));
            sweepstakes1.RegisterContestant(contestant1);
            sweepstakes1.RegisterContestant(contestant2);
            Console.ReadLine();
        }
Esempio n. 4
0
        private static void CreateDefaultContestants(Sweepstakes sweepstakes)
        {
            Contestant contestant = sweepstakes.CreateContestant("Joe", "Schmo", "*****@*****.**");

            sweepstakes.RegisterContestant(contestant);
            contestant = sweepstakes.CreateContestant("John", "Doe", "*****@*****.**");
            sweepstakes.RegisterContestant(contestant);
            contestant = sweepstakes.CreateContestant("Jane", "Doe", "*****@*****.**");
            sweepstakes.RegisterContestant(contestant);
            contestant = sweepstakes.CreateContestant("Jax", "Taylor", "*****@*****.**");
            sweepstakes.RegisterContestant(contestant);
        }
        static void Main(string[] args)
        {
            Sweepstakes sweepstakes = new Sweepstakes("powerball");



            sweepstakes.RegisterContestant(new Contestant("david", "steinhafel", "*****@*****.**", 445));
            sweepstakes.RegisterContestant(new Contestant("charlie", "sather", "*****@*****.**", 446));



            sweepstakes.Notify(sweepstakes.PickWinner());
            Console.ReadLine();
        }
Esempio n. 6
0
        static void Main(string[] args)
        {
            Sweepstakes sweepstakes = new Sweepstakes("baloon");

            Contestant one = new Contestant();
            Contestant two = new Contestant();

            sweepstakes.RegisterContestant(one);
            sweepstakes.RegisterContestant(two);

            sweepstakes.PickWinner();

            Console.ReadLine();
        }
Esempio n. 7
0
        static void Main(string[] args)
        {
            SweepstakesStackManager stackManager = new SweepstakesStackManager();
            SweepstakesQueueManager queueManager = new SweepstakesQueueManager();

            Sweepstakes sweepstakes = new Sweepstakes("Packers Ticket Giveaway");

            queueManager.InsertSweepstakes(sweepstakes);
            stackManager.InsertSweepstakes(sweepstakes);
            Console.WriteLine("Please enter at least two contestants for the " + sweepstakes.sweepstakesName + ".");
            Console.ReadLine();
            Contestant contestant = sweepstakes.CreateContestant();

            sweepstakes.RegisterContestant(contestant);
            sweepstakes.CreateContestant();
            sweepstakes.RegisterContestant(contestant);

            sweepstakes = new Sweepstakes("Brewers Ticket Giveaway");
            queueManager.InsertSweepstakes(sweepstakes);
            stackManager.InsertSweepstakes(sweepstakes);
            Console.WriteLine("Please enter at least two contestants for the " + sweepstakes.sweepstakesName + ".");
            Console.ReadLine();
            sweepstakes.CreateContestant();
            sweepstakes.RegisterContestant(contestant);
            sweepstakes.CreateContestant();
            sweepstakes.RegisterContestant(contestant);


            sweepstakes = new Sweepstakes("Bucks Ticket Giveaway");
            queueManager.InsertSweepstakes(sweepstakes);
            stackManager.InsertSweepstakes(sweepstakes);
            Console.WriteLine("Please enter at least two contestants for the " + sweepstakes.sweepstakesName + ".");
            Console.ReadLine();
            sweepstakes.CreateContestant();
            sweepstakes.RegisterContestant(contestant);
            sweepstakes.CreateContestant();
            sweepstakes.RegisterContestant(contestant);

            for (int i = 0; i < 3; i++)
            {
                Console.WriteLine(sweepstakes.sweepstakesName);
                Console.WriteLine("Queue Manager:");
                RunSweepstakes(queueManager);
                Console.WriteLine("Stack Manager:");
                RunSweepstakes(stackManager);
                Console.WriteLine();
            }
            Console.ReadLine();
        }
Esempio n. 8
0
        public void Run()
        {
            mktfrm.CreateASweepstakes(mktfrm.manager);
            Contestant  con1  = mktfrm.GetContestantInformation();
            Contestant  con2  = mktfrm.GetContestantInformation();
            Contestant  con3  = mktfrm.GetContestantInformation();
            Sweepstakes sweep = mktfrm.GetSweepstakes(mktfrm.manager);

            sweep.RegisterContestant(con1);
            sweep.RegisterContestant(con2);
            sweep.RegisterContestant(con3);
            Contestant winner = sweep.PickWinner();

            sweep.PrintContestantInfo(winner);
        }
Esempio n. 9
0
        static void Main(string[] args)
        {
            Sweepstakes WinSomething = new Sweepstakes("Win Somthing");
            Contestant  x            = new Contestant();
            Contestant  y            = new Contestant();

            WinSomething.RegisterContestant(x);
            WinSomething.RegisterContestant(y);
            Console.WriteLine();

            WinSomething.PrintContestantInfo(x);

            SweepstakesManager manager = new SweepstakesManager();
            MarketingFirm      manage  = new MarketingFirm(manager.GetSweepstakes());
        }
Esempio n. 10
0
        static void Main(string[] args)
        {
            Sweepstakes sweepstakes = new Sweepstakes("dictionary sweepstakes");

            //Contestant contestantWinner;

            sweepstakes.RegisterContestant(new Contestant());
            sweepstakes.RegisterContestant(new Contestant());
            sweepstakes.RegisterContestant(new Contestant());
            sweepstakes.RegisterContestant(new Contestant());

            //contestantWinner = sweepstakes.PickWinner();
            //sweepstakes.PrintContestantInfo(contestantWinner);
            sweepstakes.NotifyContestants(sweepstakes);
            Console.ReadLine();
        }
Esempio n. 11
0
 public void AddContestantsToSweepstakes()
 {
     for (int index = 0; index < contestants.Count; index++)
     {
         sweepstakes.RegisterContestant(contestants[index]);
     }
 }
 public void PickAmountOfContestants(Sweepstakes sweepstakes)
 {
     int amount = UserInterface.PickAmountOfContestents();
     for (int i = 0; i < amount; i++)
     {                
         sweepstakes.RegisterContestant(new Contestant());
     }
 }
Esempio n. 13
0
        static void Main(string[] args)
        {
            Contestant  man1  = new Contestant();
            Contestant  man2  = new Contestant();
            Contestant  man3  = new Contestant();
            Contestant  man4  = new Contestant();
            Contestant  man5  = new Contestant();
            Sweepstakes goose = new Sweepstakes("Test");

            goose.RegisterContestant(man1);
            goose.RegisterContestant(man2);
            goose.RegisterContestant(man3);
            goose.RegisterContestant(man4);
            goose.RegisterContestant(man5);

            Contestant poop = goose.PickWinner();
        }
Esempio n. 14
0
        public void CreatePlayers(Sweepstakes sweepstakes)
        {
            Console.WriteLine("The contestants are:");
            Contestant contestant = sweepstakes.CreateContestant("Julie", "D.", "*****@*****.**");

            sweepstakes.RegisterContestant(contestant);
            contestant = sweepstakes.CreateContestant("Brian", "D.", "*****@*****.**");
            sweepstakes.RegisterContestant(contestant);
            contestant = sweepstakes.CreateContestant("Audrey", "E.", "*****@*****.**");
            sweepstakes.RegisterContestant(contestant);
            contestant = sweepstakes.CreateContestant("Naomi", "J.", "*****@*****.**");
            sweepstakes.RegisterContestant(contestant);
            contestant = sweepstakes.CreateContestant("Tonje", "N.", "*****@*****.**");
            sweepstakes.RegisterContestant(contestant);
            sweepstakes.PrintContestantInfo(contestant);
            Console.WriteLine();
        }
Esempio n. 15
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Start Sweetstakes Test");
            Console.WriteLine("\n");

            //Create new contestants
            Contestant contestant  = new Contestant("Tom", "Tom", "*****@*****.**");
            Contestant contestant2 = new Contestant("Bob", "Bob", "*****@*****.**");
            Contestant contestant3 = new Contestant("John", "John", "*****@*****.**");
            Contestant contestant4 = new Contestant("Mike", "H", "*****@*****.**");
            Contestant contestant5 = new Contestant("Mike", "T", "*****@*****.**");
            Contestant contestant6 = new Contestant("Wade", "Wade", "*****@*****.**");

            //Create sweepstakes
            Sweepstakes sweepstakes = new Sweepstakes("WIN $5000 DOLLARS!");

            sweepstakes.RegisterContestant(contestant);
            sweepstakes.RegisterContestant(contestant2);
            sweepstakes.RegisterContestant(contestant3);

            Sweepstakes sweepstakes2 = new Sweepstakes("WIN FORTNITE THEMEPARK GET AWAY!");

            sweepstakes2.RegisterContestant(contestant4);
            sweepstakes2.RegisterContestant(contestant5);
            sweepstakes2.RegisterContestant(contestant6);

            Sweepstakes sweepstakes3 = new Sweepstakes("WIN SEASON PACKER TICKET PASSES FOR LIFE!");

            sweepstakes3.RegisterContestant(contestant4);
            sweepstakes3.RegisterContestant(contestant5);
            sweepstakes3.RegisterContestant(contestant6);

            //Create UI(Factory)
            User_Interface_Factory user_Interface = new User_Interface_Factory();

            //Create Marketing firm
            MarketingFirm marketing = new MarketingFirm(user_Interface, sweepstakes);

            Console.WriteLine(sweepstakes.PickWinner() + "\n");
            Console.WriteLine(sweepstakes2.PickWinner() + "\n");
            Console.WriteLine(sweepstakes3.PickWinner() + "\n");

            Console.WriteLine("disclaimer: any similarities are purely coincidental.");

            Console.ReadLine();
        }
Esempio n. 16
0
 public void ContestantCollection()
 {
     registrationNumber++;
     contestant = new Contestant(registrationNumber);
     UserInterface.GetFirstName(contestant);
     UserInterface.GetLastName(contestant);
     UserInterface.GetEmail(contestant);
     sweepstakes.RegisterContestant(contestant);
 }
        public void RegisterContestant(Sweepstakes sweepstakes)
        {
            Contestant contestant = new Contestant();

            contestant.firstName    = UI.PromptForContestantFirstName();
            contestant.lastName     = UI.PromptForContestantLastName();
            contestant.emailAddress = UI.PromptForContestantEmail();
            sweepstakes.RegisterContestant(contestant);
        }
Esempio n. 18
0
        public void GetEntries()
        {
            string[] newEntry = new string[3];
            newEntry[0] = UI.EnterInfo("First Name");
            newEntry[1] = UI.EnterInfo("Last Name");
            newEntry[2] = UI.EnterInfo("Email");
            string newRegistration = CurrentSweepstakes.numberOfContestants.ToString();

            CurrentSweepstakes.RegisterContestant(new Contestant(newEntry[0], newEntry[1], newEntry[2], newRegistration));
        }
Esempio n. 19
0
        public void GetUserInfoAndRegister()
        {
            string     firstName          = Userinterface.GetFirstName();
            string     lastName           = Userinterface.GetLastName();
            string     email              = Userinterface.GetUserEmail();
            int        registrationNumber = Userinterface.GetRegistrationNumber();
            Contestant contestant         = new Contestant(firstName, lastName, email, registrationNumber);

            sweepstakes.RegisterContestant(contestant);
        }
Esempio n. 20
0
 public void CreateContestant()
 {
     for (int i = 0; i < 3; i++)
     {
         sweepstakes.UI.AssignFirstName(sweepstakes.contestant);
         sweepstakes.UI.AssingLastName(sweepstakes.contestant);
         sweepstakes.UI.AssignEmail(sweepstakes.contestant);
         sweepstakes.UI.AssignRegistrationNumber(sweepstakes.contestant);
         sweepstakes.RegisterContestant(sweepstakes.contestant);
     }
 }
        static void Main(string[] args)
        {
            Sweepstakes johnSweepstakes = new Sweepstakes("John's Sweepstakes");
            Contestant  c1 = new Contestant("John", "Wick", "*****@*****.**");
            Contestant  c2 = new Contestant("Jon", "Snow", "*****@*****.**");
            Contestant  c3 = new Contestant("John", "Stewart", "*****@*****.**");

            johnSweepstakes.RegisterContestant(c1);
            johnSweepstakes.RegisterContestant(c2);
            johnSweepstakes.RegisterContestant(c3);

            johnSweepstakes.Register(c1);
            johnSweepstakes.Register(c2);
            johnSweepstakes.Register(c3);

            johnSweepstakes.PickWinner();

            /************************************************************/
            Console.ReadLine();
        }
Esempio n. 22
0
        static void Main(string[] args)
        {
            Simulation simulation = new Simulation();

            simulation.CreateMarketingFirmWithManager();
            Sweepstakes avalon = new Sweepstakes("Avalon");
            Contestant  con1   = new Contestant("Bob", "Jones", "*****@*****.**", 1234);
            Contestant  con2   = new Contestant("Billy", "Green", "*****@*****.**", 1235);
            Contestant  con3   = new Contestant("Joe", "College", "*****@*****.**", 1236);
            Contestant  con4   = new Contestant("John", "Grange", "*****@*****.**", 1237);
            Contestant  con5   = new Contestant("Cole", "Thompson", "*****@*****.**", 1238);

            avalon.RegisterContestant(con1);
            avalon.RegisterContestant(con2);
            avalon.RegisterContestant(con3);
            avalon.RegisterContestant(con4);
            avalon.RegisterContestant(con5);
            avalon.ContestantPickWinner();
            Console.ReadLine();
        }
Esempio n. 23
0
        public void makeSweepstakes()
        {
            Sweepstakes sweepstakes = new Sweepstakes(UserInterface.NamingSweepstakes());
            Contestant  contestant  = sweepstakes.CreateAContestant();

            sweepstakes.RegisterContestant(contestant);
            Contestant contestant1 = sweepstakes.PickWinner();

            sweepstakes.PrintContestantInfo(contestant);
            manager.InsertSweepstakes(sweepstakes);
        }
Esempio n. 24
0
        public Sweepstakes AddContestants(Sweepstakes sweepstakes)
        {
            int numberOfContestants = UI.AskUserForInt($"How Many Contestants Would You Like To Create For {sweepstakes.name}?");

            for (int j = 0; j < numberOfContestants; j++)
            {
                Contestant contestant = new Contestant();
                sweepstakes.RegisterContestant(contestant);
            }
            return(sweepstakes);
        }
        private Sweepstakes AddNewContestant(Sweepstakes sweepstakes)
        {
            int numberOfContestants = UserInterface.PromptForNumberOfContestants();

            for (int i = 0; i < numberOfContestants; i++)
            {
                Contestant contestant = new Contestant();
                sweepstakes.RegisterContestant(contestant);
            }
            return(sweepstakes);
        }
Esempio n. 26
0
 public void SetUpSweepstakes(ISweepstakesManager manager)
 {
     sweepstakes = new Sweepstakes(UserInterface.GetSweepstakesName());
     do
     {
         contestant = new Contestant();
         sweepstakes.RegisterContestant(contestant);
     } while (UserInterface.GetMoreContestants() == "yes");
     manager.InsertSweepstakes(sweepstakes);
     MakeMoreSweepstakes();
 }
Esempio n. 27
0
        public static void EnterContestant(Sweepstakes sweepstakes)
        {
            Contestant contestant      = EnterContestantInformation();
            int        numberOfTickets = SetNumberOfTickets();

            for (int i = 0; i < numberOfTickets; i++)
            {
                Contestant newTicket = new Contestant(contestant.firstName, contestant.lastName, contestant.email);
                sweepstakes.RegisterContestant(newTicket);
            }
        }
Esempio n. 28
0
        // method
        public void CreateSweepstake(string name)
        {
            //1. create name
            //2. add contestants
            //3. print contestant info
            //4. pick a winner

            sweepstakes = new Sweepstakes(name);
            sweepstakes.RegisterContestant(contestant);
            sweepstakes.PrintContestantInfo(contestant);
            sweepstakes.PickWinner();
        }
Esempio n. 29
0
        static void Main(string[] args)
        {
            string              selection = UserInterface.GetSweepstakesManager();
            ManagerFactory      factory   = new ManagerFactory();
            ISweepstakesManager manager   = factory.GenerateSweepstakesManager(selection);

            Sweepstakes s = new Sweepstakes(test);
            Contestant  a = new Contestant();
            Contestant  b = new Contestant();
            Contestant  c = new Contestant();
            Contestant  d = new Contestant();
            Contestant  e = new Contestant();
            Contestant  f = new Contestant();

            s.RegisterContestant(a);
            s.RegisterContestant(b);
            s.RegisterContestant(c);
            s.RegisterContestant(d);
            s.RegisterContestant(e);
            s.RegisterContestant(f);
            string winner = s.PickWinner();

            Console.WriteLine(winner);
            Console.ReadLine();
        }
Esempio n. 30
0
        public void CreateSweepstake()
        {
            Sweepstakes sweepstake          = new Sweepstakes(UserInterface.NameSweepstake());
            int         numberOfContestants = UserInterface.NumberOf("contestants");

            for (int i = 0; i < numberOfContestants; i++)
            {
                sweepstake.RegisterContestant(new Contestant());
            }
            manager.InsertSweepstakes(sweepstake);
            sweepstake.PrintContestantInfo(sweepstake.PickWinner());
            sweepstake.Notify();
        }