예제 #1
0
 //Make lemonade//Recipe
 //Number of Cup used to make lemonade
 public static int CupUsedToMakeLemonade(Recipe recipe, Inventory inventory)
 {
     Console.WriteLine("How many cup would you use to make lemonade?");
     recipe.numberOfCup = int.Parse(Console.ReadLine());
     if (recipe.numberOfCup <= inventory.CountCup())
     {
         return(recipe.numberOfCup);
     }
     else
     {
         Console.WriteLine("Invalid input.");
         return(CupUsedToMakeLemonade(recipe, inventory));
     }
 }