Advertisement
RosicaIvanova

sushi time

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