Advertisement
Aliendreamer

restaurant discount

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