Advertisement
silvana1303

World Snooker Championship

Apr 25th, 2020
534
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.18 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Loops
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string final = Console.ReadLine();
  10.             string ticket = Console.ReadLine();
  11.             int ticketCount = int.Parse(Console.ReadLine());
  12.             char trophey = char.Parse(Console.ReadLine());
  13.  
  14.             double ticketPrice = 0.0;
  15.  
  16.             if (final == "Quarter final")
  17.             {
  18.                 if (ticket == "Standard")
  19.                 {
  20.                     ticketPrice = 55.50;
  21.                 }
  22.                 else if (ticket == "Premium")
  23.                 {
  24.                     ticketPrice = 105.20;
  25.                 }
  26.                 else
  27.                 {
  28.                     ticketPrice = 118.90;
  29.                 }
  30.             }
  31.             else if (final == "Semi final")
  32.             {
  33.                 if (ticket == "Standard")
  34.                 {
  35.                     ticketPrice = 75.88;
  36.                 }
  37.                 else if (ticket == "Premium")
  38.                 {
  39.                     ticketPrice = 125.22;
  40.                 }
  41.                 else
  42.                 {
  43.                     ticketPrice = 300.40;
  44.                 }
  45.             }
  46.             else
  47.             {
  48.                 if (ticket == "Standard")
  49.                 {
  50.                     ticketPrice = 110.10;
  51.                 }
  52.                 else if (ticket == "Premium")
  53.                 {
  54.                     ticketPrice = 160.66;
  55.                 }
  56.                 else
  57.                 {
  58.                     ticketPrice = 400.0;
  59.                 }
  60.             }
  61.  
  62.             double tickets = ticketCount * ticketPrice;
  63.            
  64.  
  65.             if (tickets > 4000)
  66.             {
  67.                  tickets *= 0.75;
  68.             }
  69.             else if (tickets > 2500)
  70.             {
  71.                 tickets *= 0.90;
  72.             }
  73.  
  74.             double picturePrice = 0.0;
  75.  
  76.             if (trophey == 'Y' && tickets <= 4000)
  77.             {
  78.                 picturePrice = ticketCount * 40;
  79.             }
  80.            
  81.  
  82.             double fullPrice = tickets + picturePrice;
  83.  
  84.             Console.WriteLine($"{fullPrice:f2}");
  85.         }
  86.     }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement