Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h" // only for VS C++
- #include <iostream>
- #include <string>
- using namespace std;
- void PrintVacantionOportunities(double, string);
- int main()
- {
- double budget;
- string season;
- cin >> budget >> season;
- PrintVacantionOportunities(budget, season);
- return 0;
- }
- void PrintVacantionOportunities(double budget, string season)
- {
- string destination, place;
- double price;
- if (budget <= 100)
- {
- destination = "Bulgaria";
- if (season == "summer")
- {
- place = "Camp";
- price = budget * 0.30;
- }
- else if (season == "winter")
- {
- place = "Hotel";
- price = budget * 0.70;
- }
- }
- else if (budget <= 1000)
- {
- destination = "Balkans";
- if (season == "summer")
- {
- place = "Camp";
- price = budget * 0.40;
- }
- else if (season == "winter")
- {
- place = "Hotel";
- price = budget * 0.80;
- }
- }
- else if (budget > 1000)
- {
- destination = "Europe";
- place = "Hotel";
- price = budget * 0.90;
- }
- cout.setf(ios::fixed);
- cout.precision(2);
- cout << "Somewhere in " << destination << endl << place << " - " << price << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement