Advertisement
v4m4v4

Vacation

Oct 21st, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.08 KB | None | 0 0
  1. // Holidays.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. #include <string>
  7. #include <iomanip>
  8. using namespace std;
  9.  
  10. int main()
  11. {
  12.     double budget;
  13.     string season;
  14.     cin >> budget >> season;
  15.  
  16.     string location = " ";
  17.     string place = " ";
  18.  
  19.     if (budget <= 1000)
  20.     {
  21.         place = "Camp";
  22.         if (season == "Summer")
  23.         {
  24.             location = "Alaska";
  25.             budget *= 0.65;
  26.         }
  27.         else if (season == "Winter")
  28.         {
  29.             location = "Morocco";
  30.             budget *= 0.45;
  31.         }
  32.     }
  33.     else if (budget > 1000 && budget <= 3000)
  34.     {
  35.         place = "Hut";
  36.         if (season == "Summer")
  37.         {
  38.             location = "Alaska";
  39.             budget *= 0.8;
  40.         }
  41.         else if (season == "Winter")
  42.         {
  43.             location = "Morocco";
  44.             budget *= 0.6;
  45.         }
  46.     }
  47.     else if (budget > 3000)
  48.     {
  49.         place = "Hotel";
  50.         if (season == "Summer")
  51.         {
  52.             location = "Alaska";
  53.             budget *= 0.9;
  54.         }
  55.         else if (season == "Winter")
  56.         {
  57.             location = "Morocco";
  58.             budget *= 0.9;
  59.         }
  60.     }
  61.  
  62.     cout << location << " - " << place << " - "
  63.         << fixed << setprecision(2) << budget << endl;
  64.  
  65.     return 0;
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement