Nephelir

Untitled

Jan 29th, 2020
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cmath>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int vacantionDays;
  10. string roomType;
  11. string evaluation;
  12.  
  13. cin >> vacantionDays >> roomType >> evaluation;
  14.  
  15. double discount = 0;
  16. double priceForNight = 0;
  17. //double totalAmount = 0;
  18.  
  19. if (vacantionDays < 10)
  20. {
  21. if (roomType == "room for one person")
  22. {
  23. priceForNight = 18.00;
  24. }
  25. else if (roomType == "apartment")
  26. {
  27. priceForNight = 25.00;
  28. discount = 30; //30% от крайната цена
  29. }
  30. else if (roomType == "president apartment")
  31. {
  32. priceForNight = 35.00;
  33. discount = 10;
  34. }
  35. }
  36. else if (vacantionDays >= 10 && vacantionDays <= 15)
  37. {
  38. if (roomType == "room for one person")
  39. {
  40. priceForNight = 18.00;
  41. }
  42. else if (roomType == "apartment")
  43. {
  44. priceForNight = 25.00;
  45. discount = 35;
  46. }
  47. else if (roomType == "president apartment")
  48. {
  49. priceForNight = 35.00;
  50. discount = 15;
  51. }
  52. }
  53. else if (vacantionDays > 15)
  54. {
  55. if (roomType == "room for one person")
  56. {
  57. priceForNight = 18.00;
  58. }
  59. else if (roomType == "apartment")
  60. {
  61. priceForNight = 25.00;
  62. discount = 50;
  63. }
  64. else if (roomType == "president apartment")
  65. {
  66. priceForNight = 35.00;
  67. discount = 20;
  68. }
  69. }
  70.  
  71. double totalAmount = (vacantionDays * priceForNight - priceForNight) * discount;
  72.  
  73.  
  74. /*if (evaluation == "positive")
  75. {
  76. totalAmount + totalAmount * 0.25;
  77. }
  78. */
  79.  
  80.  
  81. cout << totalAmount << endl;
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92. return 0;
  93. }
Advertisement
Add Comment
Please, Sign In to add comment