Advertisement
desislava_topuzakova

Coffee.cs

Jul 2nd, 2023
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace RegularExam_UASD
  6. {
  7. internal class Coffee
  8. {
  9. private string type;
  10. private double price;
  11.  
  12. public Coffee()
  13. {
  14.  
  15. }
  16.  
  17. public Coffee(string type, double price)
  18. {
  19. Type = type;
  20. Price = price;
  21. }
  22. public string Type
  23. {
  24. get
  25. {
  26. return type;
  27. }
  28. set
  29. {
  30. type = value;
  31. }
  32. }
  33. public double Price
  34. {
  35. get
  36. {
  37. return price;
  38. }
  39. set
  40. {
  41. price = value;
  42. }
  43. }
  44.  
  45. public override string ToString()
  46. {
  47. return $"Coffee {Type} costs {Price:F2} lv.";
  48. }
  49.  
  50. }
  51. }
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement