Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cmath>
- using namespace std;
- int main()
- {
- int vacantionDays;
- string roomType;
- string evaluation;
- cin >> vacantionDays >> roomType >> evaluation;
- double discount = 0;
- double priceForNight = 0;
- //double totalAmount = 0;
- if (vacantionDays < 10)
- {
- if (roomType == "room for one person")
- {
- priceForNight = 18.00;
- }
- else if (roomType == "apartment")
- {
- priceForNight = 25.00;
- discount = 30; //30% от крайната цена
- }
- else if (roomType == "president apartment")
- {
- priceForNight = 35.00;
- discount = 10;
- }
- }
- else if (vacantionDays >= 10 && vacantionDays <= 15)
- {
- if (roomType == "room for one person")
- {
- priceForNight = 18.00;
- }
- else if (roomType == "apartment")
- {
- priceForNight = 25.00;
- discount = 35;
- }
- else if (roomType == "president apartment")
- {
- priceForNight = 35.00;
- discount = 15;
- }
- }
- else if (vacantionDays > 15)
- {
- if (roomType == "room for one person")
- {
- priceForNight = 18.00;
- }
- else if (roomType == "apartment")
- {
- priceForNight = 25.00;
- discount = 50;
- }
- else if (roomType == "president apartment")
- {
- priceForNight = 35.00;
- discount = 20;
- }
- }
- double totalAmount = (vacantionDays * priceForNight - priceForNight) * discount;
- /*if (evaluation == "positive")
- {
- totalAmount + totalAmount * 0.25;
- }
- */
- cout << totalAmount << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment