Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication1
  8. {
  9. public abstract class Burger
  10. {
  11. public int price;
  12. public int callorie;
  13.  
  14. public void Calc()
  15. {
  16. Cheese c = new Cheese();
  17. c.ADD_calorie(priceCheese);
  18.  
  19. }
  20. }
  21.  
  22. public class SmallBurger : Burger
  23. {
  24. public int Smallprice = 50;
  25. public int Smallcallorie = 20;
  26. }
  27.  
  28. public class BigBurger : Burger
  29. {
  30. public int Bigprice = 100;
  31. public int Bigcallorie = 40;
  32. }
  33. public abstract class Ingridient
  34. {
  35. public int Ingrprice;
  36. public int Ingrcallorie;
  37.  
  38. public void ADD_price(int price)
  39. {
  40. this.price += Ingrprice;
  41. }
  42.  
  43. public void ADD_calorie(int callorie)
  44. {
  45. this.callorie += Ingrcallorie;
  46. }
  47. }
  48. public class Cheese : Ingridient
  49. {
  50. public int priceCheese = 10;
  51. public int callorieCheese = 20;
  52.  
  53. }
  54. class Program
  55. {
  56. static void Main(string[] args)
  57. {
  58. BigBurger bb = new BigBurger();
  59. SmallBurger sb = new SmallBurger();
  60.  
  61.  
  62. Console.ReadKey();
  63. }
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement