Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication1
- {
- public abstract class Burger
- {
- public int price;
- public int callorie;
- public void Calc()
- {
- Cheese c = new Cheese();
- c.ADD_calorie(priceCheese);
- }
- }
- public class SmallBurger : Burger
- {
- public int Smallprice = 50;
- public int Smallcallorie = 20;
- }
- public class BigBurger : Burger
- {
- public int Bigprice = 100;
- public int Bigcallorie = 40;
- }
- public abstract class Ingridient
- {
- public int Ingrprice;
- public int Ingrcallorie;
- public void ADD_price(int price)
- {
- this.price += Ingrprice;
- }
- public void ADD_calorie(int callorie)
- {
- this.callorie += Ingrcallorie;
- }
- }
- public class Cheese : Ingridient
- {
- public int priceCheese = 10;
- public int callorieCheese = 20;
- }
- class Program
- {
- static void Main(string[] args)
- {
- BigBurger bb = new BigBurger();
- SmallBurger sb = new SmallBurger();
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement