Exemplo n.º 1
0
        static void Option3TypeOfFood(int input)
        {
            string[] Sandwhiches = { "Ham", "Bacon", "Tuna" };
            string[] Salads      = { "Tuna Salad", "Cheese Salad", "Caesar Salad" };
            string[] HotSnacks   = { "Cheese and Ham Toastie", "Tuna Toastie", "Chips" };

            switch (input)
            {
            case 1:
                Foodoption.RandomMethod(Sandwhiches);
                break;

            case 2:
                Foodoption.RandomMethod(Salads);
                break;

            case 3:
                Foodoption.RandomMethod(HotSnacks);
                break;

            default:
                Console.WriteLine("Please Enter a Correct Option");
                break;
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Foodoption.WelcomeText();
            //Try Catch incase of wrong Input
            try
            {
                //Storing Users Input
                string userinput = Console.ReadLine();
                int    input     = int.Parse(userinput);

                //Placing users input through switch statement to decide what method to call
                switch (input)
                {
                case 1:
                    Option1.Option();
                    break;

                case 2:
                    Option2.Option();
                    break;

                case 3:
                    Option3.Option();
                    break;

                default:
                    Console.WriteLine("Please Enter a Correct Option");
                    break;
                }
            }
            catch
            {
                Console.WriteLine("Please Enter a Correct Option!");
            }
        }
Exemplo n.º 3
0
 static void Mcdonalds()
 {
     string[] Mcdees = { "Ham", "Bacon", "Tuna" };
     Foodoption.RandomMethod(Mcdees);
 }