예제 #1
0
    {// member variables (HAS A)
     // constructor
     // member methods (CAND DO)
        public ISweepstakesManager DetermineManager(string answer)
        {
            ISweepstakesManager sweepstakesManager;

            switch (answer)
            {
            case "stack":
                SweepstakesStackManager sweepstakesStackManager = new SweepstakesStackManager();
                sweepstakesManager = sweepstakesStackManager;
                break;


            case "queue":

                SweepstakesQueueManager sweepstakesQueueManager = new SweepstakesQueueManager();
                sweepstakesManager = sweepstakesQueueManager;
                break;


            default:

                UserInterface.DisplayWrongInput();
                string tryagain = UserInterface.AskQueueOrStack();
                sweepstakesManager = DetermineManager(tryagain);
                break;
            }

            return(sweepstakesManager);
        }