Advertisement
koksibg

Restaurant_Discount

May 25th, 2017
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.83 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Restaurant_Discount
  4. {
  5.     class Restaurant_Discount
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int groupSize = int.Parse(Console.ReadLine());
  10.             string package = Console.ReadLine();
  11.             double price1 = 0;
  12.             double price2 = 0;
  13.             double discount = 0;
  14.             double totalPrice = 0;
  15.             double sumTotalPrice = 0;
  16.             double pricePerPerson = 0;
  17.             string hall = "";
  18.             if (groupSize <= 50)
  19.             {
  20.                 price1 = 2500;
  21.                 hall = "Small Hall";
  22.             }
  23.             else if (groupSize > 50 && groupSize <= 100)
  24.             {
  25.                 price1 = 5000;
  26.                 hall = "Terrace";
  27.             }
  28.             else if (groupSize > 100 && groupSize <= 120)
  29.             {
  30.                 price1 = 7500;
  31.                 hall = "Great Hall";
  32.             }
  33.             if (package == "Normal")
  34.             {
  35.                 price2 = 500;
  36.                 discount = 0.05;
  37.             }
  38.             else if (package == "Gold")
  39.             {
  40.                 price2 = 750;
  41.                 discount = 0.10;
  42.             }
  43.             else if (package == "Platinum")
  44.             {
  45.                 price2 = 1000;
  46.                 discount = 0.15;
  47.             }
  48.             totalPrice = price1 + price2;
  49.             sumTotalPrice = totalPrice - discount * totalPrice;
  50.             pricePerPerson = sumTotalPrice / groupSize;
  51.             if (groupSize > 120)
  52.             {
  53.                 Console.WriteLine($"We do not have an appropriate hall.");
  54.             }
  55.             else
  56.             {
  57.                 Console.WriteLine($"We can offer you the {hall}");
  58.                 Console.WriteLine($"The price per person is {pricePerPerson:f2}$");
  59.             }
  60.         }
  61.     }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement