Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface IQuantityKilo
- {
- void DisplayQuantityKilo();
- }
- interface IQuantityLiter
- {
- void DisplayQuantityLiter();
- }
- abstract class TypeProductsInBag
- {
- public abstract void CalculateTypeProductsInBag(int quantity);
- }
- class FruitsInBag:TypeProductsInBag, IQuantityKilo
- {
- public int NumberFruitInBag { get; set; }
- public override void CalculateTypeProductsInBag(int quantity)
- {
- NumberFruitInBag += quantity;
- }
- public void DisplayQuantityKilo()
- {
- //wyświetl ilość kilogramów
- }
- }
- class DrinksInBag : TypeProductsInBag, IQuantityLiter
- {
- public int NumberDrinksInBag { get; set; }
- public override void CalculateTypeProductsInBag(int quantity)
- {
- NumberDrinksInBag += quantity;
- }
- public void DisplayQuantityLiter()
- {
- //wyświetl ilość litrów
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement