aggressiveviking

Untitled

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