desislava_topuzakova

Product

Apr 18th, 2020
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace Shop
  6. {
  7. class Product
  8. {
  9. //полета
  10. private string name;
  11. private string code;
  12. private double price;
  13. private double quantity;
  14.  
  15. //методи
  16. public Product (string name1, string code1, double price1, double quantity1)
  17. {
  18. Name = name1;
  19. Code = code1;
  20. Price = price1;
  21. Quantity = quantity1;
  22. }
  23. public string Name
  24. {
  25. get
  26. {
  27. return name;
  28. }
  29. set
  30. {
  31. name = value;
  32. }
  33. }
  34.  
  35. public string Code
  36. {
  37. get
  38. {
  39. return code;
  40. }
  41. set
  42. {
  43. code = value;
  44. }
  45. }
  46.  
  47. public double Price
  48. {
  49. get
  50. {
  51. return price;
  52. }
  53. set
  54. {
  55. price = value;
  56. }
  57. }
  58.  
  59. public double Quantity
  60. {
  61. get
  62. {
  63. return quantity;
  64. }
  65. set
  66. {
  67. quantity = value;
  68. }
  69. }
  70. }
  71. }
Add Comment
Please, Sign In to add comment