Exemplo n.º 1
0
 //Number of Sugar used to make lemonade
 public static int SugarUsedToMakeLemonade(Recipe recipe, Inventory inventory)
 {
     Console.WriteLine("How many cup of sugar would you use to make lemonade?");
     recipe.numberOfSugar = int.Parse(Console.ReadLine());
     if (recipe.numberOfSugar <= inventory.CountSugar())
     {
         return(recipe.numberOfSugar);
     }
     else
     {
         Console.WriteLine("Invalid input.");
         return(SugarUsedToMakeLemonade(recipe, inventory));
     }
 }