Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.92 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cmath>
  4. using namespace std;
  5.  
  6. int main () {
  7.  
  8.  
  9.     string typeOfShushi;
  10.     cin >> typeOfShushi;
  11.     cin.ignore();
  12.     string NameOfRestaurant;
  13.     getline(cin, NameOfRestaurant);
  14.     int portions;
  15.     cin >> portions;
  16.     char YorN;
  17.     cin >> YorN;
  18.     double sum = 0;
  19.     double percent = 0;
  20.     bool NameRestaurant = false;
  21.  
  22.         if(typeOfShushi == "sashimi"){
  23.                 if(NameOfRestaurant == "Sushi Zone"){
  24.                         sum = portions * 4.99;
  25.                         NameRestaurant = true;
  26.                         if(YorN == 'Y'){
  27.                             sum += sum * 0.2;
  28.                         }
  29.  
  30.                 }else if(NameOfRestaurant == "Sushi Time"){
  31.                         sum = portions * 5.49;
  32.                         NameRestaurant = true;
  33.                         if(YorN == 'Y'){
  34.                             sum += sum * 0.2;
  35.                         }
  36.  
  37.                 }else if(NameOfRestaurant == "Sushi Bar"){
  38.                         sum = portions * 5.25;
  39.                         NameRestaurant = true;
  40.                         if(YorN == 'Y'){
  41.                             sum += sum * 0.2;
  42.                         }
  43.                 }else if(NameOfRestaurant == "Asian Pub"){
  44.                         sum = portions * 4.50;
  45.                       NameRestaurant = true;
  46.                         if(YorN == 'Y'){
  47.                             sum += sum * 0.2;
  48.                         }
  49.                 }else {
  50.                     ///ne validen restorant
  51.                    /// cout << NameOfRestaurant << " is invalid restaurant!" << endl;
  52.                    NameRestaurant = false;
  53.                 }
  54.  
  55.         }
  56.  
  57.  
  58.         if(typeOfShushi == "maki"){
  59.  
  60.                  if(NameOfRestaurant == "Sushi Zone"){
  61.                         sum = portions * 5.29;
  62.                         NameRestaurant = true;
  63.                         if(YorN == 'Y'){
  64.                             sum += sum * 0.2;
  65.                         }
  66.  
  67.                 }else if(NameOfRestaurant == "Sushi Time"){
  68.                         sum = portions * 4.69;
  69.                        NameRestaurant = true;
  70.                         if(YorN == 'Y'){
  71.                             sum += sum * 0.2;
  72.                         }
  73.  
  74.                 }else if(NameOfRestaurant == "Sushi Bar"){
  75.                         sum = portions * 5.55;
  76.                        NameRestaurant = true;
  77.                         if(YorN == 'Y'){
  78.                             sum += sum * 0.2;
  79.                         }
  80.                 }else if(NameOfRestaurant == "Asian Pub"){
  81.                         sum = portions * 4.80;
  82.                         NameRestaurant = true;
  83.                         if(YorN == 'Y'){
  84.                             sum += sum * 0.2;
  85.                         }
  86.                 }else {
  87.                     ///ne validen restorant
  88.                   ///  cout << NameOfRestaurant << " is invalid restaurant!" << endl;
  89.                     NameRestaurant = false;
  90.                 }
  91.  
  92.         }
  93.  
  94.         if(typeOfShushi == "urumaki"){
  95.                 if(NameOfRestaurant == "Sushi Zone"){
  96.                         sum = portions * 5.99;
  97.                        NameRestaurant = true;
  98.                         if(YorN == 'Y'){
  99.                             sum += sum * 0.2;
  100.                         }
  101.  
  102.                 }else if(NameOfRestaurant == "Sushi Time"){
  103.                         sum = portions * 4.49;
  104.                         NameRestaurant = true;
  105.                         if(YorN == 'Y'){
  106.                             sum += sum * 0.2;
  107.                         }
  108.  
  109.                 }else if(NameOfRestaurant == "Sushi Bar"){
  110.                         sum = portions * 6.25;
  111.                        NameRestaurant = true;
  112.                         if(YorN == 'Y'){
  113.                             sum += sum * 0.2;
  114.                         }
  115.                 }else if(NameOfRestaurant == "Asian Pub"){
  116.                         sum = portions * 5.50;
  117.                         NameRestaurant = true;
  118.                         if(YorN == 'Y'){
  119.                             sum += sum * 0.2;
  120.                         }
  121.                 }else {
  122.                     ///ne validen restorant
  123.                    /// cout << NameOfRestaurant << " is invalid restaurant!" << endl;
  124.                         NameRestaurant = false;
  125.                 }
  126.  
  127.  
  128.         }
  129.  
  130.         if(typeOfShushi == "temaki"){
  131.                 if(NameOfRestaurant == "Sushi Zone"){
  132.                         sum = portions * 4.29;
  133.                        NameRestaurant = true;
  134.                         if(YorN == 'Y'){
  135.                             sum += sum * 0.2;
  136.                         }
  137.  
  138.                 }else if(NameOfRestaurant == "Sushi Time"){
  139.                         sum = portions * 5.19;
  140.                        NameRestaurant = true;
  141.                         if(YorN == 'Y'){
  142.                             sum += sum * 0.2;
  143.                         }
  144.  
  145.                 }else if(NameOfRestaurant == "Sushi Bar"){
  146.                         sum = portions * 4.75;
  147.                        NameRestaurant = true;
  148.                         if(YorN == 'Y'){
  149.                             sum += sum * 0.2;
  150.                         }
  151.                 }else if(NameOfRestaurant == "Asian Pub"){
  152.                         sum = portions * 5.50;
  153.                        NameRestaurant = true;
  154.                         if(YorN == 'Y'){
  155.                             sum += sum * 0.2;
  156.                         }
  157.                 }else {
  158.                     ///ne validen restorant
  159.                     ///cout << NameOfRestaurant << " is invalid restaurant!" << endl;
  160.                     NameRestaurant = false;
  161.                 }
  162.  
  163.         }
  164.  
  165.     if(NameRestaurant){
  166.  
  167.         cout << "Total price: " << ceil(sum)  << " lv." << endl;
  168.  
  169.     }else {
  170.     cout << NameOfRestaurant << " is invalid restaurant!" << endl;
  171.  
  172.     }
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.     return 0;
  180. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement