BubaLazi

03RestaurantDiscount

May 30th, 2017
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.64 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 HomeworksConditionalStatments
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var groupSize = int.Parse(Console.ReadLine());
  14.             var servicePackage = Console.ReadLine();
  15.            
  16.             var price = 0.00;
  17.             var discount = 0.00;
  18.             var totalPrice = 0.00;
  19.             var servicePrice = 0.00;
  20.             var serviceDiscount = 0.00;
  21.  
  22.  
  23.             if (groupSize <= 50)
  24.             {
  25.                 var hallPrice = 2500;
  26.                 if (servicePackage == "Normal")
  27.                 {
  28.                     servicePrice = 500;
  29.                     serviceDiscount = 0.05;
  30.                 }
  31.                 else if (servicePackage == "Gold")
  32.                 {
  33.                     servicePrice = 750;
  34.                     serviceDiscount = 0.10;
  35.                 }
  36.                 else if (servicePackage == "Platinum")
  37.                 {
  38.                     servicePrice = 1000;
  39.                     serviceDiscount = 0.15;
  40.                 }
  41.                 totalPrice = hallPrice + servicePrice;
  42.                 discount = totalPrice - (totalPrice * serviceDiscount);
  43.                 var pricePerPerson = discount / groupSize;
  44.                 Console.WriteLine("We can offer you the Small Hall");
  45.                 Console.WriteLine("The price per person is {0:F2}$", pricePerPerson);
  46.             }
  47.             else if (groupSize > 50 && groupSize <= 100)
  48.             {
  49.                 var hallPrice = 5000;
  50.                 if (servicePackage == "Normal")
  51.                 {
  52.                     servicePrice = 500;
  53.                     serviceDiscount = 0.05;
  54.                 }
  55.                 else if (servicePackage == "Gold")
  56.                 {
  57.                     servicePrice = 750;
  58.                     serviceDiscount = 0.10;
  59.                 }
  60.                 else if (servicePackage == "Platinum")
  61.                 {
  62.                     servicePrice = 1000;
  63.                     serviceDiscount = 0.15;
  64.                 }
  65.                 totalPrice = hallPrice + servicePrice;
  66.                 discount = totalPrice - (totalPrice * serviceDiscount);
  67.                 var pricePerPerson = discount / groupSize;
  68.                 Console.WriteLine("We can offer you the Terrace");
  69.                 Console.WriteLine("The price per person is {0:F2}$", pricePerPerson);
  70.             }
  71.             else if (groupSize > 100 && groupSize <= 120)
  72.             {
  73.                 var hallPrice = 7500;
  74.                 if (servicePackage == "Normal")
  75.                 {
  76.                     servicePrice = 500;
  77.                     serviceDiscount = 0.05;
  78.                 }
  79.                 else if (servicePackage == "Gold")
  80.                 {
  81.                     servicePrice = 750;
  82.                     serviceDiscount = 0.10;
  83.                 }
  84.                 else if (servicePackage == "Platinum")
  85.                 {
  86.                     servicePrice = 1000;
  87.                     serviceDiscount = 0.15;
  88.                 }
  89.                 totalPrice = hallPrice + servicePrice;
  90.                 discount = totalPrice - (totalPrice * serviceDiscount);
  91.                 var pricePerPerson = discount / groupSize;
  92.                 Console.WriteLine("We can offer you the Great Hall");
  93.                 Console.WriteLine("The price per person is {0:F2}$", pricePerPerson);
  94.             }
  95.             else if(groupSize > 120)
  96.             {
  97.                 Console.WriteLine("We do not have an appropriate hall.");
  98.             }
  99.  
  100.            
  101.         }
  102.     }
  103. }
Advertisement
Add Comment
Please, Sign In to add comment