Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.72 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _03._Vacation
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int people = int.Parse(Console.ReadLine());
  10.             string typeOfTheGroup = Console.ReadLine();
  11.             string dayOfWeek = Console.ReadLine();
  12.             double toralPrice = 0;
  13.             switch (typeOfTheGroup)
  14.             {
  15.                 case "Students":
  16.                     if (dayOfWeek == "Friday")
  17.                     {
  18.                         toralPrice = people * 8.45;
  19.                     }
  20.                     else if (dayOfWeek == "Saturday")
  21.                     {
  22.                         toralPrice = people * 9.80;
  23.                     }
  24.                     else if (dayOfWeek == "Sunday")
  25.                     {
  26.                         toralPrice = people * 10.46;
  27.                     }
  28.                     if (people >= 30)
  29.                     {
  30.                         toralPrice *= 0.85;
  31.                     }
  32.                     break;
  33.                 case "Business":
  34.                     if (dayOfWeek == "Friday")
  35.                     {
  36.                         toralPrice = people * 10.90;
  37.                         if (people >= 100)
  38.                         {
  39.                             toralPrice = (people - 10) * 10.90;
  40.                         }
  41.                     }
  42.                     else if (dayOfWeek == "Saturday")
  43.                     {
  44.                         toralPrice = people * 15.60;
  45.                         if (people >= 100)
  46.                         {
  47.                             toralPrice = (people - 10) * 15.60;
  48.                         }
  49.                     }
  50.                     else if (dayOfWeek == "Sunday")
  51.                     {
  52.                         toralPrice = people * 16;
  53.                         if (people >= 100)
  54.                         {
  55.                             toralPrice = (people - 10) * 16;
  56.                         }
  57.                     }
  58.                     break;
  59.                 case "Regular":
  60.                     if (dayOfWeek == "Friday")
  61.                     {
  62.                         toralPrice = people * 15;
  63.                     }
  64.                     else if (dayOfWeek == "Saturday")
  65.                     {
  66.                         toralPrice = people * 20;
  67.                     }
  68.                     else if (dayOfWeek == "Sunday")
  69.                     {
  70.                         toralPrice = people * 22.50;
  71.                     }
  72.                     if (people >= 10 && people <= 20)
  73.                     {
  74.                         toralPrice *= 0.95;
  75.                     }
  76.                     break;
  77.             }
  78.             Console.WriteLine($"Total price: {toralPrice:f2}");
  79.  
  80.         }
  81.     }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement