Advertisement
Guest User

Vacation

a guest
Jan 24th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.17 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _03Vacation
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int groupOfPeople = int.Parse(Console.ReadLine());
  10.             string typeOfGroup = Console.ReadLine();
  11.             string dayOfWeek = Console.ReadLine();
  12.  
  13.             decimal price = 0m;
  14.             decimal totalPrice = 0m;
  15.  
  16.             if(dayOfWeek == "Friday")
  17.             {
  18.                 if(typeOfGroup == "Students")
  19.                 {
  20.                     if (groupOfPeople >= 30)
  21.                     {
  22.                         price = 8.45m;
  23.                         totalPrice = price * groupOfPeople;
  24.                         totalPrice = totalPrice - (totalPrice * 0.15m);
  25.                     }
  26.                     else
  27.                     {
  28.                         price = 8.45m;
  29.                         totalPrice = price * groupOfPeople;
  30.                     }
  31.                 }
  32.                 else if(typeOfGroup == "Business")
  33.                 {
  34.                     if (groupOfPeople >= 100)
  35.                     {
  36.                         price = 10.90m;
  37.                         totalPrice = price * (groupOfPeople-10);
  38.                     }
  39.                     else
  40.                     {
  41.                         price = 10.90m;
  42.                         totalPrice = price * groupOfPeople;
  43.                     }
  44.                 }
  45.                 else if (typeOfGroup == "Regular")
  46.                 {
  47.                     if (groupOfPeople >= 10 && groupOfPeople <= 20)
  48.                     {
  49.                         price = 15m;
  50.                         totalPrice = price * groupOfPeople;
  51.                         totalPrice = totalPrice - (totalPrice * 0.05m);
  52.                     }
  53.                     else
  54.                     {
  55.                         price = 15m;
  56.                         totalPrice = price * groupOfPeople;
  57.                     }
  58.                 }
  59.             }
  60.             else if(dayOfWeek == "Saturday")
  61.             {
  62.                 if (typeOfGroup == "Students")
  63.                 {
  64.                     if (groupOfPeople >= 30)
  65.                     {
  66.                         price = 9.80m;
  67.                         totalPrice = price * groupOfPeople;
  68.                         totalPrice = totalPrice - (totalPrice * 0.15m);
  69.                     }
  70.                     else
  71.                     {
  72.                         price = 9.80m;
  73.                         totalPrice = price * groupOfPeople;
  74.                     }
  75.                 }
  76.                 else if (typeOfGroup == "Business")
  77.                 {
  78.                     if (groupOfPeople >= 100)
  79.                     {
  80.                         price = 15.60m;
  81.                         totalPrice = price * (groupOfPeople - 10);
  82.                     }
  83.                     else
  84.                     {
  85.                         price = 15.60m;
  86.                         totalPrice = price * groupOfPeople;
  87.                     }
  88.                 }
  89.                 else if (typeOfGroup == "Regular")
  90.                 {
  91.                     if (groupOfPeople >= 10 && groupOfPeople <= 20)
  92.                     {
  93.                         price = 20m;
  94.                         totalPrice = price * groupOfPeople;
  95.                         totalPrice = totalPrice - (totalPrice * 0.05m);
  96.                     }
  97.                     else
  98.                     {
  99.                         price = 20m;
  100.                         totalPrice = price * groupOfPeople;
  101.                     }
  102.                 }
  103.             }
  104.             else if(dayOfWeek == "Sunday")
  105.             {
  106.                 if (typeOfGroup == "Students")
  107.                 {
  108.                     if (groupOfPeople >= 30)
  109.                     {
  110.                         price = 10.46m;
  111.                         totalPrice = price * groupOfPeople;
  112.                         totalPrice = totalPrice - (totalPrice * 0.15m);
  113.                     }
  114.                     else
  115.                     {
  116.                         price = 10.46m;
  117.                         totalPrice = price * groupOfPeople;
  118.                     }
  119.                 }
  120.                 else if (typeOfGroup == "Business")
  121.                 {
  122.                     if (groupOfPeople >= 100)
  123.                     {
  124.                         price = 16m;
  125.                         totalPrice = price * (groupOfPeople - 10);
  126.                     }
  127.                     else
  128.                     {
  129.                         price = 16m;
  130.                         totalPrice = price * groupOfPeople;
  131.                     }
  132.                 }
  133.                 else if (typeOfGroup == "Regular")
  134.                 {
  135.                     if (groupOfPeople >= 10 && groupOfPeople <= 20)
  136.                     {
  137.                         price = 22.50m;
  138.                         totalPrice = price * groupOfPeople;
  139.                         totalPrice = totalPrice - (totalPrice * 0.05m);
  140.                     }
  141.                     else
  142.                     {
  143.                         price = 22.50m;
  144.                         totalPrice = price * groupOfPeople;
  145.                     }
  146.                 }
  147.             }
  148.             Console.WriteLine($"Total price: {totalPrice:F2}");
  149.         }
  150.     }
  151. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement