Threed90

Journey

Oct 3rd, 2018
152
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "pch.h" // only for VS C++
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. void PrintVacantionOportunities(double, string);
  8.  
  9. int main()
  10. {
  11.     double budget;
  12.     string season;
  13.     cin >> budget >> season;
  14.  
  15.     PrintVacantionOportunities(budget, season);
  16.     return 0;
  17. }
  18.  
  19. void PrintVacantionOportunities(double budget, string season)
  20. {
  21.     string destination, place;
  22.     double price;
  23.  
  24.     if (budget <= 100)
  25.     {
  26.         destination = "Bulgaria";
  27.         if (season == "summer")
  28.         {
  29.             place = "Camp";
  30.             price = budget * 0.30;
  31.         }
  32.         else if (season == "winter")
  33.         {
  34.             place = "Hotel";
  35.             price = budget * 0.70;
  36.         }
  37.     }
  38.     else if (budget <= 1000)
  39.     {
  40.         destination = "Balkans";
  41.         if (season == "summer")
  42.         {
  43.             place = "Camp";
  44.             price = budget * 0.40;
  45.         }
  46.         else if (season == "winter")
  47.         {
  48.             place = "Hotel";
  49.             price = budget * 0.80;
  50.         }
  51.     }
  52.     else if (budget > 1000)
  53.     {
  54.         destination = "Europe";
  55.         place = "Hotel";
  56.         price = budget * 0.90;
  57.     }
  58.  
  59.     cout.setf(ios::fixed);
  60.     cout.precision(2);
  61.     cout << "Somewhere in " << destination << endl << place << " - " << price << endl;
  62. }
RAW Paste Data