Advertisement
alexbancheva

Sushi Time

Nov 25th, 2019
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.03 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Sushi_Time_Exam_24._11
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string sushiType = Console.ReadLine();
  10.             string restaurantName = Console.ReadLine();
  11.             int countOfServing = int.Parse(Console.ReadLine());
  12.             char order = char.Parse(Console.ReadLine());
  13.  
  14.             double totalPrice = 0;
  15.             bool flag = true;
  16.            
  17.  
  18.             switch (restaurantName)
  19.             {
  20.                 case "Sushi Zone":
  21.                 case "Sushi Time":
  22.                 case "Sushi Bar":
  23.                 case "Asian Pub":
  24.                     break;
  25.                 default:
  26.                     flag = false;
  27.                     Console.WriteLine($"{restaurantName} is invalid restaurant!");
  28.                     break;
  29.             }
  30.  
  31.             if (flag)
  32.             {
  33.                 if (restaurantName == "Sushi Zone")
  34.                 {
  35.                     if (sushiType == "sashimi")
  36.                     {
  37.                         totalPrice = countOfServing * 4.99;
  38.                     }
  39.                     else if (sushiType == "maki")
  40.                     {
  41.                         totalPrice = countOfServing * 5.29;
  42.                     }
  43.                     else if (sushiType == "uramaki")
  44.                     {
  45.                         totalPrice = countOfServing * 5.99;
  46.                     }
  47.                     else if (sushiType == "temaki")
  48.                     {
  49.                         totalPrice = countOfServing * 4.29;
  50.                     }
  51.                 }
  52.                 else if (restaurantName == "Sushi Time")
  53.                 {
  54.                     if (sushiType == "sashimi")
  55.                     {
  56.                         totalPrice = countOfServing * 5.49;
  57.                     }
  58.                     else if (sushiType == "maki")
  59.                     {
  60.                         totalPrice = countOfServing * 4.69;
  61.                     }
  62.                     else if (sushiType == "uramaki")
  63.                     {
  64.                         totalPrice = countOfServing * 4.49;
  65.                     }
  66.                     else if (sushiType == "temaki")
  67.                     {
  68.                         totalPrice = countOfServing * 5.19;
  69.                     }
  70.                 }
  71.                 else if (restaurantName == "Sushi Bar")
  72.                 {
  73.                     if (sushiType == "sashimi")
  74.                     {
  75.                         totalPrice = countOfServing * 5.25;
  76.                     }
  77.                     else if (sushiType == "maki")
  78.                     {
  79.                         totalPrice = countOfServing * 5.55;
  80.                     }
  81.                     else if (sushiType == "uramaki")
  82.                     {
  83.                         totalPrice = countOfServing * 6.25;
  84.                     }
  85.                     else if (sushiType == "temaki")
  86.                     {
  87.                         totalPrice = countOfServing * 4.75;
  88.                     }
  89.                 }
  90.                 else if (restaurantName == "Asian Pub")
  91.                 {
  92.                     if (sushiType == "sashimi")
  93.                     {
  94.                         totalPrice = countOfServing * 4.50;
  95.                     }
  96.                     else if (sushiType == "maki")
  97.                     {
  98.                         totalPrice = countOfServing * 4.80;
  99.                     }
  100.                     else if (sushiType == "uramaki")
  101.                     {
  102.                         totalPrice = countOfServing * 5.50;
  103.                     }
  104.                     else if (sushiType == "temaki")
  105.                     {
  106.                         totalPrice = countOfServing * 5.50;
  107.                     }
  108.                 }
  109.  
  110.                 double delivery = totalPrice * 0.20;
  111.                 if (order == 'Y')
  112.                 {
  113.                     totalPrice = totalPrice + delivery;
  114.                 }
  115.  
  116.                 Console.WriteLine($"Total price: {Math.Ceiling(totalPrice)} lv.");
  117.             }
  118.         }
  119.     }
  120. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement