Advertisement
Guest User

Задача 3 - Хотелска стая

a guest
Sep 24th, 2016
435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 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 Hotelska_staq
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string month = Console.ReadLine(); ;
  14. int days = int.Parse(Console.ReadLine());
  15. double priceS;
  16. double priceA;
  17. double wholePs;
  18. double wholePa;
  19.  
  20. if (month == "May" || month == "October")
  21. {
  22. priceS = 50;
  23. priceA = 65;
  24. if (days > 7 && days < 14) //// не >=, а >
  25. {
  26. priceS = priceS - (priceS * 5 / 100);
  27. wholePs = priceS * days;
  28. wholePa = priceA * days;
  29.  
  30. Console.WriteLine("Apartment: {0:f2} lv.", wholePa);
  31. Console.WriteLine("Studio: {0:f2} lv.", wholePs);
  32. }
  33. else if (days >= 14)
  34. {
  35. priceS = priceS - (priceS * 30 / 100);
  36. priceA = priceA - (priceA * 10 / 100);
  37. wholePs = priceS * days;
  38. wholePa = priceA * days;
  39.  
  40. Console.WriteLine("Apartment: {0:f2} lv.", wholePa);
  41. Console.WriteLine("Studio: {0:f2} lv.", wholePs);
  42. }
  43. else
  44. {
  45. wholePs = priceS * days;
  46. wholePa = priceA * days;
  47.  
  48. Console.WriteLine("Apartment: {0:f2} lv.", wholePa);
  49. Console.WriteLine("Studio: {0:f2} lv.", wholePs);
  50. }
  51. }
  52. if (month == "June" || month == "September")
  53. {
  54. priceS = 75.20;
  55. priceA = 68.70;
  56. if (days > 14) ///// повече от 14!!!!!!!!!
  57. {
  58. priceS = priceS - (priceS * 20 / 100);
  59. priceA = priceA - (priceA * 10 / 100);
  60.  
  61. wholePs = priceS * days;
  62. wholePa = priceA * days;
  63.  
  64. Console.WriteLine("Apartment: {0:f2} lv.", wholePa);
  65. Console.WriteLine("Studio: {0:f2} lv.", wholePs);
  66. }
  67. else
  68. {
  69. wholePs = priceS * days;
  70. wholePa = priceA * days;
  71.  
  72. Console.WriteLine("Apartment: {0:f2} lv.", wholePa);
  73. Console.WriteLine("Studio: {0:f2} lv.", wholePs);
  74. }
  75. }
  76. if (month == "July" || month == "August")
  77. {
  78. priceS = 76;
  79. priceA = 77;
  80. if (days > 14) /// повече от 14
  81. {
  82. priceA = priceA - (priceA * 10 / 100);
  83. wholePs = priceS * days;
  84. wholePa = priceA * days;
  85.  
  86. Console.WriteLine("Apartment: {0:f2} lv.", wholePa);
  87. Console.WriteLine("Studio: {0:f2} lv.", wholePs);
  88. }
  89. else
  90. {
  91. wholePs = priceS * days;
  92. wholePa = priceA * days;
  93.  
  94. Console.WriteLine("Apartment: {0:f2} lv.", wholePa);
  95. Console.WriteLine("Studio: {0:f2} lv.", wholePs);
  96. }
  97. }
  98. }
  99. }
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement