コード例 #1
0
ファイル: UI.cs プロジェクト: MikolaZhmendak/LemonadeStand
        public static void AskForPlayerRecipe(Recipe recipe)
        {
            string userChoice;

            Console.WriteLine();
            Console.WriteLine(" Here is the summary of you recipe ");
            Console.WriteLine(" Price is $" + recipe.setPricePerCup);
            Console.WriteLine(" Number of ice cubes in your lemonade: " + recipe.iceCubesUsed);
            Console.WriteLine(" Number of lemons in your lemonade: " + recipe.lemonsUsed);
            Console.WriteLine(" Number of sugar cubes in your lemonade : " + recipe.sugarsUsed);
            Console.WriteLine();
            Console.WriteLine("________________________________________________________________________");
            Console.WriteLine(" Now since you have entered the ingredients let make a recipe for 1 cup of lemonade");
            Console.WriteLine(" You can enter amount of ingredients now and set you price per cup");
            Console.WriteLine(" Plese enter S(ugar), I(ce), L(emons), P(rice) for you lemonade");
            userChoice = Console.ReadLine().ToUpper();
            switch (userChoice)
            {
            case "I":
                recipe.AddingIceCubes(recipe);
                AskForPlayerRecipe(recipe);

                break;

            case "L":
                recipe.AddingLemons(recipe);
                AskForPlayerRecipe(recipe);
                break;

            case "S":
                recipe.AddingSugar(recipe);
                AskForPlayerRecipe(recipe);
                break;

            case "P":
                recipe.SettingPrice(recipe);
                AskForPlayerRecipe(recipe);
                break;
            }
        }