Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cmath>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. string sushiType;
  9. getline(cin, sushiType);
  10.  
  11. string restaurantName;
  12. getline(cin, restaurantName);
  13.  
  14. string portionsS;
  15. getline(cin, portionsS);
  16.  
  17. int portions = stoi(portionsS);
  18.  
  19. string delivery;
  20. getline(cin, delivery);
  21.  
  22. double endPrice = 0;
  23.  
  24. if (restaurantName == "Sushi Zone")
  25. {
  26. if (sushiType == "sashimi")
  27. {
  28. endPrice = 4.99 * portions;
  29. }
  30.  
  31. else if (sushiType == "maki")
  32. {
  33. endPrice = 5.29 * portions;
  34. }
  35.  
  36. else if (sushiType == "uramaki")
  37. {
  38. endPrice = 5.99 * portions;
  39. }
  40.  
  41. else if (sushiType == "temaki")
  42. {
  43. endPrice = 4.29 * portions;
  44. }
  45. }
  46.  
  47. else if (restaurantName == "Sushi Time")
  48. {
  49. if (sushiType == "sashimi")
  50. {
  51. endPrice = 5.49 * portions;
  52. }
  53.  
  54. else if (sushiType == "maki")
  55. {
  56. endPrice = 4.69 * portions;
  57. }
  58.  
  59. else if (sushiType == "uramaki")
  60. {
  61. endPrice = 4.49 * portions;
  62. }
  63.  
  64. else if (sushiType == "temaki")
  65. {
  66. endPrice = 5.19 * portions;
  67. }
  68. }
  69.  
  70. else if (restaurantName == "Sushi Bar")
  71. {
  72. if (sushiType == "sashimi")
  73. {
  74. endPrice = 5.25 * portions;
  75. }
  76.  
  77. else if (sushiType == "maki")
  78. {
  79. endPrice = 5.55 * portions;
  80. }
  81.  
  82. else if (sushiType == "uramaki")
  83. {
  84. endPrice = 6.25 * portions;
  85. }
  86.  
  87. else if (sushiType == "temaki")
  88. {
  89. endPrice = 4.75 * portions;
  90. }
  91. }
  92.  
  93. else if (restaurantName == "Asian Pub")
  94. {
  95. if (sushiType == "sashimi")
  96. {
  97. endPrice = 4.50 * portions;
  98. }
  99.  
  100. else if (sushiType == "maki")
  101. {
  102. endPrice = 4.80 * portions;
  103. }
  104.  
  105. else if (sushiType == "uramaki")
  106. {
  107. endPrice = 5.50 * portions;
  108. }
  109.  
  110. else if (sushiType == "temaki")
  111. {
  112. endPrice = 5.50 * portions;
  113. }
  114. }
  115.  
  116. else
  117. {
  118. cout << restaurantName << " is invalid restaurant!" << endl;
  119. return 0;
  120. }
  121.  
  122. if (delivery == "Y")
  123. {
  124. endPrice *= 1.20;
  125. }
  126.  
  127. cout << "Total price: " << ceil(endPrice) << " lv." << endl;
  128.  
  129. return 0;
  130. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement