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 typeOfShushi;
- cin >> typeOfShushi;
- cin.ignore();
- string NameOfRestaurant;
- getline(cin, NameOfRestaurant);
- int portions;
- cin >> portions;
- char YorN;
- cin >> YorN;
- double sum = 0;
- double percent = 0;
- bool NameRestaurant = false;
- if(typeOfShushi == "sashimi"){
- if(NameOfRestaurant == "Sushi Zone"){
- sum = portions * 4.99;
- NameRestaurant = true;
- if(YorN == 'Y'){
- sum += sum * 0.2;
- }
- }else if(NameOfRestaurant == "Sushi Time"){
- sum = portions * 5.49;
- NameRestaurant = true;
- if(YorN == 'Y'){
- sum += sum * 0.2;
- }
- }else if(NameOfRestaurant == "Sushi Bar"){
- sum = portions * 5.25;
- NameRestaurant = true;
- if(YorN == 'Y'){
- sum += sum * 0.2;
- }
- }else if(NameOfRestaurant == "Asian Pub"){
- sum = portions * 4.50;
- NameRestaurant = true;
- if(YorN == 'Y'){
- sum += sum * 0.2;
- }
- }else {
- ///ne validen restorant
- /// cout << NameOfRestaurant << " is invalid restaurant!" << endl;
- NameRestaurant = false;
- }
- }
- if(typeOfShushi == "maki"){
- if(NameOfRestaurant == "Sushi Zone"){
- sum = portions * 5.29;
- NameRestaurant = true;
- if(YorN == 'Y'){
- sum += sum * 0.2;
- }
- }else if(NameOfRestaurant == "Sushi Time"){
- sum = portions * 4.69;
- NameRestaurant = true;
- if(YorN == 'Y'){
- sum += sum * 0.2;
- }
- }else if(NameOfRestaurant == "Sushi Bar"){
- sum = portions * 5.55;
- NameRestaurant = true;
- if(YorN == 'Y'){
- sum += sum * 0.2;
- }
- }else if(NameOfRestaurant == "Asian Pub"){
- sum = portions * 4.80;
- NameRestaurant = true;
- if(YorN == 'Y'){
- sum += sum * 0.2;
- }
- }else {
- ///ne validen restorant
- /// cout << NameOfRestaurant << " is invalid restaurant!" << endl;
- NameRestaurant = false;
- }
- }
- if(typeOfShushi == "urumaki"){
- if(NameOfRestaurant == "Sushi Zone"){
- sum = portions * 5.99;
- NameRestaurant = true;
- if(YorN == 'Y'){
- sum += sum * 0.2;
- }
- }else if(NameOfRestaurant == "Sushi Time"){
- sum = portions * 4.49;
- NameRestaurant = true;
- if(YorN == 'Y'){
- sum += sum * 0.2;
- }
- }else if(NameOfRestaurant == "Sushi Bar"){
- sum = portions * 6.25;
- NameRestaurant = true;
- if(YorN == 'Y'){
- sum += sum * 0.2;
- }
- }else if(NameOfRestaurant == "Asian Pub"){
- sum = portions * 5.50;
- NameRestaurant = true;
- if(YorN == 'Y'){
- sum += sum * 0.2;
- }
- }else {
- ///ne validen restorant
- /// cout << NameOfRestaurant << " is invalid restaurant!" << endl;
- NameRestaurant = false;
- }
- }
- if(typeOfShushi == "temaki"){
- if(NameOfRestaurant == "Sushi Zone"){
- sum = portions * 4.29;
- NameRestaurant = true;
- if(YorN == 'Y'){
- sum += sum * 0.2;
- }
- }else if(NameOfRestaurant == "Sushi Time"){
- sum = portions * 5.19;
- NameRestaurant = true;
- if(YorN == 'Y'){
- sum += sum * 0.2;
- }
- }else if(NameOfRestaurant == "Sushi Bar"){
- sum = portions * 4.75;
- NameRestaurant = true;
- if(YorN == 'Y'){
- sum += sum * 0.2;
- }
- }else if(NameOfRestaurant == "Asian Pub"){
- sum = portions * 5.50;
- NameRestaurant = true;
- if(YorN == 'Y'){
- sum += sum * 0.2;
- }
- }else {
- ///ne validen restorant
- ///cout << NameOfRestaurant << " is invalid restaurant!" << endl;
- NameRestaurant = false;
- }
- }
- if(NameRestaurant){
- cout << "Total price: " << ceil(sum) << " lv." << endl;
- }else {
- cout << NameOfRestaurant << " is invalid restaurant!" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement