Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cmath>
- using namespace std;
- int main()
- {
- string sushiType;
- getline(cin, sushiType);
- string restaurantName;
- getline(cin, restaurantName);
- string portionsS;
- getline(cin, portionsS);
- int portions = stoi(portionsS);
- string delivery;
- getline(cin, delivery);
- double endPrice = 0;
- if (restaurantName == "Sushi Zone")
- {
- if (sushiType == "sashimi")
- {
- endPrice = 4.99 * portions;
- }
- else if (sushiType == "maki")
- {
- endPrice = 5.29 * portions;
- }
- else if (sushiType == "uramaki")
- {
- endPrice = 5.99 * portions;
- }
- else if (sushiType == "temaki")
- {
- endPrice = 4.29 * portions;
- }
- }
- else if (restaurantName == "Sushi Time")
- {
- if (sushiType == "sashimi")
- {
- endPrice = 5.49 * portions;
- }
- else if (sushiType == "maki")
- {
- endPrice = 4.69 * portions;
- }
- else if (sushiType == "uramaki")
- {
- endPrice = 4.49 * portions;
- }
- else if (sushiType == "temaki")
- {
- endPrice = 5.19 * portions;
- }
- }
- else if (restaurantName == "Sushi Bar")
- {
- if (sushiType == "sashimi")
- {
- endPrice = 5.25 * portions;
- }
- else if (sushiType == "maki")
- {
- endPrice = 5.55 * portions;
- }
- else if (sushiType == "uramaki")
- {
- endPrice = 6.25 * portions;
- }
- else if (sushiType == "temaki")
- {
- endPrice = 4.75 * portions;
- }
- }
- else if (restaurantName == "Asian Pub")
- {
- if (sushiType == "sashimi")
- {
- endPrice = 4.50 * portions;
- }
- else if (sushiType == "maki")
- {
- endPrice = 4.80 * portions;
- }
- else if (sushiType == "uramaki")
- {
- endPrice = 5.50 * portions;
- }
- else if (sushiType == "temaki")
- {
- endPrice = 5.50 * portions;
- }
- }
- else
- {
- cout << restaurantName << " is invalid restaurant!" << endl;
- return 0;
- }
- if (delivery == "Y")
- {
- endPrice *= 1.20;
- }
- cout << "Total price: " << ceil(endPrice) << " lv." << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement