Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # include <iostream>
- using namespace std;
- #include <iomanip>
- #include <math.h>
- #include <cmath>
- #include <string>
- int main()
- {
- int days;
- cin >> days;
- cin.ignore();
- int nights = days - 1;
- string room;
- getline (cin, room);
- string evaluation;
- getline (cin, evaluation);
- int roomprice = 18;
- int apartmentprice = 25;
- int presidentprice = 35;
- if (nights < 10)
- {
- if (room == "room for one person")
- {
- if (evaluation == "positive")
- {
- cout << fixed << setprecision(2) << ((nights * roomprice) + (nights * roomprice) * 0.25) << endl;
- }
- else
- {
- cout << fixed << setprecision(2) << (nights * roomprice)*0.9 << endl;
- }
- }
- if (room == "apartment")
- {
- if (evaluation == "positive")
- {
- cout << fixed << setprecision(2) << ((nights * apartmentprice)*0.7 + (nights * apartmentprice)*0.7 * 0.25) << endl;
- }
- else
- {
- cout << fixed << setprecision(2) << (nights * apartmentprice)*0.7*0.9 << endl;
- }
- }
- if (room == "president apartment")
- {
- if (evaluation == "positive")
- {
- cout << fixed << setprecision(2) << ((nights * presidentprice) * 0.9 + (nights * presidentprice) * 0.9 * 0.25) << endl;
- }
- else
- {
- cout << fixed << setprecision(2) << ((nights * presidentprice) * 0.9)*0.9 << endl;
- }
- }
- }
- if (nights >= 10 && nights < 15)
- {
- if (room == "room for one person")
- {
- if (evaluation == "positive")
- {
- cout << fixed << setprecision(2) << ((nights * roomprice) + (nights * roomprice) * 0.25) << endl;
- }
- else
- {
- cout << fixed << setprecision(2) << (nights * roomprice) * 0.9 << endl;
- }
- }
- if (room == "apartment")
- {
- if (evaluation == "positive")
- {
- cout << (nights * apartmentprice) << endl;
- cout << fixed << setprecision(2) << ((nights * apartmentprice)*0.65) + ((nights * apartmentprice)*0.65*0.25) << endl;
- }
- else
- {
- cout << fixed << setprecision(2) << (nights * apartmentprice)*0.65 * 0.9 << endl;
- }
- }
- if (room == "president apartment")
- {
- if (evaluation == "positive")
- {
- cout << fixed << setprecision(2) << ((nights * presidentprice) * 0.85 + (nights * presidentprice) * 0.85 * 0.25) << endl;
- }
- else
- {
- cout << fixed << setprecision(2) << ((nights * presidentprice) * 0.85) * 0.9 << endl;
- }
- }
- }
- if (nights >= 15)
- {
- if (room == "room for one person")
- {
- if (evaluation == "positive")
- {
- cout << fixed << setprecision(2) << ((nights * roomprice) + (nights * roomprice) * 0.25) << endl;
- }
- else
- {
- cout << fixed << setprecision(2) << (nights * roomprice) * 0.9 << endl;
- }
- }
- if (room == "apartment")
- {
- if (evaluation == "positive")
- {
- cout << fixed << setprecision(2) << ((nights * apartmentprice) * 0.5 + (nights * apartmentprice) * 0.5 * 0.25) << endl;
- }
- else
- {
- cout << fixed << setprecision(2) << (nights * apartmentprice) * 0.5 * 0.9 << endl;
- }
- }
- if (room == "president apartment")
- {
- if (evaluation == "positive")
- {
- cout << fixed << setprecision(2) << ((nights * presidentprice) * 0.8 + (nights * presidentprice) * 0.8 * 0.25) << endl;
- }
- else
- {
- cout << fixed << setprecision(2) << ((nights * presidentprice) * 0.8) * 0.9 << endl;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement