Beispiel #1
0
        public void DiscardRequest(char c)

        {
            string result;

            switch (char.ToLower(c))
            {
            case 'm':
                result = Discard.DiscardMilk(this, cart);

                break;

            case 'b':
                result = Discard.DiscardBread(this, cart);

                break;

            case 'e':
                result = Discard.DiscardEggs(this, cart);

                break;

            case 'o':
                result = Discard.DiscardOranges(this, cart);

                break;

            case 'p':
                result = Discard.DiscardPepsi(this, cart);
                break;

            case 'f':
                result = "";
                break;

            default:
                result = "\nTry again!";
                break;
            }
            Console.WriteLine(result);
        }