public void AddNewDrinks() { string Excerpt; string Country_made; int Cost; int Volume; Console.Write("\nEnter a excerpt of drinks: "); Excerpt = Console.ReadLine(); Console.Write("Enter a country made of drinks: "); Country_made = Console.ReadLine(); Console.Write("Enter a drinks price: "); while (!int.TryParse(Console.ReadLine(), out Cost) || Cost <= 0) { Console.Write("Enter a correct speed value: "); } Console.Write("Enter a whiskey's volume of bottle: "); while (!int.TryParse(Console.ReadLine(), out Volume) || Volume > 10 || Volume < 0) { Console.Write("Enter a correct volume: "); } Drinks newDrinks = new Drinks(Excerpt, Country_made, Cost, Volume); nap.Add(newDrinks); }
public void DisplayInfoAboutDrinks(Drinks Drinks) { Console.WriteLine("\nExcerpt : {0}\nCountry_made : {1}\nCost : {2}\nVolume : {3}", Drinks.Excerpt, Drinks.Country_made, Drinks.Cost, Drinks.Volume); }