Advertisement
wigllytest

Untitled

Aug 7th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. string month;
  8. int nights;
  9. cin >> month >> nights;
  10.  
  11. double stPrice = 0;
  12. double apStudio = 0;
  13.  
  14. if (month == "May" || month == "October")
  15. {
  16.  
  17. if (nights > 7 && nights <= 13)
  18. {
  19. stPrice = 50 * 0.95;
  20. apStudio = 65;
  21. }
  22. else if (nights > 14)
  23. {
  24. stPrice = 50 * 0.7;
  25. apStudio = 65 * 0.9;
  26. }
  27. else
  28. {
  29. stPrice = 50;
  30. apStudio = 65;
  31. }
  32.  
  33. }
  34. else if (month == "June" || month == "September")
  35. {
  36.  
  37.  
  38. if (nights > 14)
  39. {
  40. stPrice = 75.2 * 0.8;
  41. apStudio = 68.7 * 0.9;
  42. }
  43. else
  44. {
  45. stPrice = 75.2;
  46. apStudio = 68.7;
  47. }
  48.  
  49. }
  50. else if (month == "July" || month == "August")
  51. {
  52. stPrice = 76;
  53. apStudio = 77;
  54. if (nights > 14)
  55. {
  56. apStudio = 77 * 0.9;
  57. }
  58.  
  59.  
  60.  
  61. }
  62.  
  63. cout.setf(ios::fixed);
  64. cout.precision(2);
  65.  
  66. cout << "Apartment: " << apStudio * nights << " lv." << endl;
  67. cout << "Studio: " << stPrice * nights << " lv.";
  68.  
  69.  
  70.  
  71. return 0;
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement