Advertisement
Guest User

Untitled

a guest
Mar 28th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _3
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. var fruit = Console.ReadLine();
  10. var size = Console.ReadLine();
  11. var numberOfSets = int.Parse(Console.ReadLine());
  12.  
  13. var priceForSet = 0.0;
  14.  
  15.  
  16. if(fruit == "Watermelon")
  17. {
  18. if (size == "small")
  19. {
  20. priceForSet = 2 * 56.0;
  21. }
  22. else
  23. {
  24. priceForSet = 5 * 28.70;
  25. }
  26. }
  27. else if(fruit == "Mango")
  28. {
  29. if (size == "small")
  30. {
  31. priceForSet = 2 * 36.66;
  32. }
  33. else
  34. {
  35. priceForSet = 5 * 19.60;
  36. }
  37. }
  38. else if(fruit == "Pineapple")
  39. {
  40. if (size == "small")
  41. {
  42. priceForSet = 2 * 42.10;
  43. }
  44. else
  45. {
  46. priceForSet = 5 * 24.80;
  47. }
  48. }
  49. else if(fruit == "Raspberry")
  50. {
  51. if (size == "small")
  52. {
  53. priceForSet = 2 * 20.0;
  54. }
  55. else
  56. {
  57. priceForSet = 5 * 15.20;
  58. }
  59. }
  60.  
  61. var discount = 0.0;
  62.  
  63. if(priceForSet * numberOfSets >= 400 && priceForSet * numberOfSets <= 1000)
  64. {
  65. discount = 15.0 * priceForSet * numberOfSets / 100.0;
  66.  
  67. }
  68. else if(priceForSet * numberOfSets > 1000)
  69. {
  70. discount = priceForSet * numberOfSets / 2.0;
  71. }
  72.  
  73.  
  74. Console.WriteLine("{0:0.00} lv.", priceForSet * numberOfSets - discount);
  75.  
  76.  
  77.  
  78. }
  79. }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement