Advertisement
bacco

Restaurant Discount

May 15th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.66 KB | None | 0 0
  1. using System;
  2. using System.Threading;
  3. using System.Xml.Schema;
  4.  
  5. namespace tESt
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             var sizeGroup = int.Parse(Console.ReadLine());
  12.             var package = Console.ReadLine();
  13.  
  14.             double totalPrice = 0;
  15.  
  16.             if (sizeGroup > 120)
  17.             {
  18.                 Console.WriteLine("We do not have an appropriate hall.");
  19.             }
  20.             else
  21.             {
  22.                 if (sizeGroup <= 50)
  23.                 {
  24.                     Console.WriteLine($"We can offer you the Small Hall");
  25.  
  26.                     if (package == "Normal")
  27.                     {
  28.                         totalPrice = (2500 + 500) * 0.95; // 5%
  29.                     }
  30.                     if (package == "Gold")
  31.                     {
  32.                         totalPrice = (2500 + 750) * 0.90; // 10%
  33.                     }
  34.                     if (package == "Platinum")
  35.                     {
  36.                         totalPrice = (2500 + 1000) * 0.85; // 15%
  37.                     }
  38.                 }
  39.                 else if (sizeGroup <= 100)
  40.                 {
  41.                     Console.WriteLine($"We can offer you the Terrace");
  42.  
  43.                     if (package == "Normal")
  44.                     {
  45.                         totalPrice = (5000 + 500) * 0.95; // 5%
  46.                     }
  47.                     if (package == "Gold")
  48.                     {
  49.                         totalPrice = (5000 + 750) * 0.90; // 10%
  50.                     }
  51.                     if (package == "Platinum")
  52.                     {
  53.                         totalPrice = (5000 + 1000) * 0.85; // 15%
  54.                     }
  55.                 }
  56.                 else if (sizeGroup <= 120)
  57.                 {
  58.                     Console.WriteLine($"We can offer you the Great Hall");
  59.  
  60.                     if (package == "Normal")
  61.                     {
  62.                         totalPrice = (7500 + 500) * 0.95; // 5%
  63.                     }
  64.                     if (package == "Gold")
  65.                     {
  66.                         totalPrice = (7500 + 750) * 0.90; // 10%
  67.                     }
  68.                     if (package == "Platinum")
  69.                     {
  70.                         totalPrice = (7500 + 1000) * 0.85; // 15%
  71.                     }
  72.                 }
  73.                 var pricePerPerson = totalPrice / sizeGroup;
  74.  
  75.                 Console.WriteLine($"The price per person is {pricePerPerson:f2}$");
  76.             }
  77.         }
  78.     }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement