wigllytest

Untitled

Aug 7th, 2020
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int main() {
  6.  
  7. double budget;
  8. string season;
  9. cin >> budget;
  10. cin >> season;
  11.  
  12. string place, accomodation;
  13. double cost = 0;
  14.  
  15. if (budget <= 100)
  16. {
  17. place = "Bulgaria";
  18.  
  19. if (season == "summer")
  20. {
  21. cost = budget * 0.3;
  22. accomodation = "Camp";
  23. }
  24. else if (season == "winter")
  25. {
  26. cost = budget * 0.7;
  27. accomodation = "Hotel";
  28. }
  29. }
  30. else if (budget > 100 && budget <= 1000)
  31. {
  32. place = "Balkans";
  33.  
  34. if (season == "summer")
  35. {
  36. cost = budget * 0.4;
  37. accomodation = "Camp";
  38. }
  39. else if (season == "winter")
  40. {
  41. cost = budget * 0.8;
  42. accomodation = "Hotel";
  43. }
  44. }
  45. else if (budget > 1000)
  46. {
  47. place = "Europe";
  48. cost = budget * 0.9;
  49. accomodation = "Hotel";
  50. }
  51.  
  52. //• Първи ред – „Somewhere in [дестинация]“ измежду “Bulgaria", "Balkans” и ”Europe”
  53. //• Втори ред – “{ Вид почивка } –{ Похарчена сума }“
  54.  
  55. cout.setf(ios::fixed);
  56. cout.precision(2);
  57.  
  58. cout << "Somewhere in " << place << endl;
  59. cout << accomodation << " - " << cost;
  60.  
  61.  
  62. return 0;
  63. }
Advertisement
Add Comment
Please, Sign In to add comment