示例#1
0
 //Number of Ice cube to make lemonade
 public static int IceCubeUsedToMakeLemonade(Recipe recipe, Inventory inventory)
 {
     Console.WriteLine("How many ice cube would you use to make lemonade?");
     recipe.numberOfIceCube = int.Parse(Console.ReadLine());
     if (recipe.numberOfIceCube <= inventory.CountIceCube())
     {
         return(recipe.numberOfIceCube);
     }
     else
     {
         Console.WriteLine("Invalid input.");
         return(IceCubeUsedToMakeLemonade(recipe, inventory));
     }
 }