Advertisement
Daniel_007

03. World Snooker

Oct 26th, 2019
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.46 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp3
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string stage = Console.ReadLine();
  10.             string type = Console.ReadLine();
  11.             int howMany = int.Parse(Console.ReadLine());
  12.             char picture = char.Parse(Console.ReadLine());
  13.             double money = 0;
  14.             switch (stage)
  15.             {
  16.                 case "Quarter final":
  17.                     switch (type)
  18.                     {
  19.                         case "Standard":
  20.                             money = 55.50 * howMany;
  21.                             break;
  22.                         case "Premium":
  23.                             money = 105.20 * howMany;
  24.                             break;
  25.                         case "VIP":
  26.                             money = 118.90 * howMany;
  27.                             break;
  28.                     }
  29.                     break;
  30.                 case "Semi final":
  31.                     switch (type)
  32.                     {
  33.                         case "Standard":
  34.                             money = 75.88 * howMany;
  35.                             break;
  36.                         case "Premium":
  37.                             money = 125.22 * howMany;
  38.                             break;
  39.                         case "VIP":
  40.                             money = 300.40 * howMany;
  41.                             break;
  42.                     }
  43.                     break;
  44.                 case "Final":
  45.                     switch (type)
  46.                     {
  47.                         case "Standard":
  48.                             money = 110.10 * howMany;
  49.                             break;
  50.                         case "Premium":
  51.                             money = 160.66 * howMany;
  52.                             break;
  53.                         case "VIP":
  54.                             money = 400.00 * howMany;
  55.                             break;
  56.                     }
  57.                     break;
  58.             }
  59.             if (money > 4000)
  60.             {
  61.                 money = money * 0.75;
  62.             }
  63.             else if (money > 2500)
  64.             {
  65.                 money = money * 0.9;
  66.                 if (picture == 'Y')
  67.                 {
  68.                     money = money + howMany * 40;
  69.                 }
  70.             }else if(picture == 'Y')
  71.             {
  72.                 money += howMany*40;
  73.             }
  74.             Console.WriteLine($"{money:F2}");
  75.         }
  76.     }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement