Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Bottle
- {
- public string DrinkType { get; set; }
- public int CurrentDrinkAmount { get; set; }
- public void Drink(int amountToDrink)
- {
- if (CurrentDrinkAmount < amountToDrink)
- {
- Console.WriteLine("Not enough drink in the bottle.");
- }
- else
- {
- CurrentDrinkAmount -= amountToDrink;
- Console.WriteLine($"Just drank {amountToDrink} ml of {DrinkType}.");
- }
- }
- public void CheckAmount()
- {
- Console.WriteLine($"There are still {CurrentDrinkAmount} ml of {DrinkType} in the bottle.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement