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;
- string restorantName;
- string portion;
- string order;
- getline (cin, sushiType);
- getline (cin, restorantName);
- getline(cin, portion);
- getline (cin, order);
- int portions = stoi(portion);
- bool restorantNameCorrect = restorantName == "Sushi Zone"
- || restorantName == "Sushi Time"
- || restorantName == "Sushi Zone"
- || restorantName == "Asian Pub";
- double price = 0.0;
- if (restorantName == "Sushi Zone") {
- if (sushiType == "sashimi") {
- price = portions * 4.99;
- }else if (sushiType == "maki") {
- price = portions * 5.29;
- } else if (sushiType == "uramaki") {
- price = portions * 5.99;
- } else if (sushiType == "temaki") {
- price = portions * 4.29;
- }
- } else if (restorantName == "Sushi Time") {
- if (sushiType == "sashimi") {
- price = portions * 5.49;
- }else if (sushiType == "maki") {
- price = portions * 4.69;
- } else if (sushiType == "uramaki") {
- price = portions * 4.49;
- } else if (sushiType == "temaki") {
- price = portions * 5.19;
- }
- } else if (restorantName == "Sushi Bar") {
- if (sushiType == "sashimi") {
- price = portions * 5.25;
- }else if (sushiType == "maki") {
- price = portions * 5.55;
- } else if (sushiType == "uramaki") {
- price = portions * 6.25;
- } else if (sushiType == "temaki") {
- price = portions * 4.75;
- }
- } else if (restorantName == "Asian Pub") {
- if (sushiType == "sashimi") {
- price = portions * 4.50;
- }else if (sushiType == "maki") {
- price = portions * 4.80;
- } else if (sushiType == "uramaki" || sushiType == "temaki") {
- price = portions * 5.50;
- }
- }
- double delivery = price + (price * 0.20);
- double noDelivery = price;
- if (!restorantNameCorrect) {
- cout << restorantName << " is invalid restaurant!\n";
- } else {
- if (order == "Y") {
- cout << "Total price: " << ceil(delivery) << " lv.\n";
- } else if (order == "N") {
- cout << "Total price: " << ceil(noDelivery) << " lv.\n";
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement