Advertisement
angelneychev

03. Sushi Time

Oct 28th, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.02 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _03.Sushi_Time
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.             string typeSushi = Console.ReadLine();
  15.             string restorant = Console.ReadLine();
  16.             int quantity = int.Parse(Console.ReadLine());
  17.             string delivery = Console.ReadLine();
  18.             double sum = 0;
  19.             double sashimi = 0;
  20.             double maki = 0;
  21.             double uramaki = 0;
  22.             double temaki = 0;
  23.             //"sashimi", "maki", "uramaki", "temaki"
  24.             // "Sushi Zone", "Sushi Time", "Sushi Bar", "Asian Pub"
  25.  
  26.             switch (restorant)
  27.             {
  28.                 case "Sushi Zone":
  29.                     sashimi = 4.99;
  30.                     maki = 5.29;
  31.                     uramaki = 5.99;
  32.                     temaki = 4.29;
  33.                     break;
  34.                 case "Sushi Time":
  35.                     sashimi = 5.49;
  36.                     maki = 4.69;
  37.                     uramaki = 4.49;
  38.                     temaki = 5.19;
  39.                     break;
  40.                 case "Sushi Bar":
  41.                     sashimi = 5.25;
  42.                     maki = 5.55;
  43.                     uramaki = 6.25;
  44.                     temaki = 4.75;
  45.                     break;
  46.                 case "Asian Pub":
  47.                     sashimi = 4.50;
  48.                     maki = 4.80;
  49.                     uramaki = 5.50;
  50.                     temaki = 5.50;
  51.                     break;
  52.                 //default:
  53.                 //    Console.WriteLine($"{restorant} is invalid restaurant");
  54.                 //    break;
  55.             }
  56.             switch (typeSushi)
  57.             {
  58.                 case "sashimi":
  59.                     sum = sashimi * quantity;
  60.                     break;
  61.                 case "maki":
  62.                     sum = maki * quantity;
  63.                     break;
  64.                 case "uramaki":
  65.                     sum = uramaki * quantity;
  66.                     break;
  67.                 case "temaki":
  68.                     sum = temaki * quantity;
  69.                     break;
  70.                 //default:
  71.                 //    Console.WriteLine("Invalid stock!");
  72.                  //   break;
  73.             }
  74.             //"Sushi Zone", "Sushi Time", "Sushi Bar", "Asian Pub"
  75.             if ((restorant != "Sushi Zone") && (restorant != "Sushi Time") && (restorant != "Sushi Bar") && (restorant != "Asian Pub"))
  76.             {
  77.                 Console.WriteLine($"{restorant} is invalid restaurant!");
  78.             }
  79.             else if (delivery == "Y")
  80.             {
  81.                 double moneyDelivery = sum * 0.2;
  82.                 double allMoney = sum + moneyDelivery;
  83.                 Console.WriteLine($"Total price: {Math.Ceiling(allMoney)} lv.");
  84.             }
  85.             else if (delivery == "N")
  86.             {
  87.                 Console.WriteLine($"Total price: {Math.Ceiling(sum)} lv.");
  88.             }
  89.         }
  90.     }
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement