Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace World_Snooker_Championship
- {
- class Program
- {
- static void Main(string[] args)
- {
- string stage = Console.ReadLine();
- string type = Console.ReadLine();
- int numTickets = int.Parse(Console.ReadLine());
- char picture = char.Parse(Console.ReadLine());
- double unitPrice = 0.0;
- if (stage == "Quarter final")
- {
- switch (type)
- {
- case "Standard": unitPrice = 55.50; break;
- case "Premium": unitPrice = 105.20; break;
- case "VIP": unitPrice = 118.90; break;
- }
- }
- else if (stage == "Semi final")
- {
- switch (type)
- {
- case "Standard": unitPrice = 75.88; break;
- case "Premium": unitPrice = 125.22; break;
- case "VIP": unitPrice = 300.40; break;
- }
- }
- else if (stage == "Final")
- {
- switch (type)
- {
- case "Standard": unitPrice = 110.10; break;
- case "Premium": unitPrice = 160.66; break;
- case "VIP": unitPrice = 400.0; break;
- }
- }
- double price = numTickets * unitPrice;
- if (price > 4000)
- {
- price *= 0.75;
- Console.WriteLine($"{price:f2}");
- return;
- }
- else if (price > 2500)
- {
- price *= 0.90;
- }
- if (picture == 'Y')
- {
- price += (numTickets * 40.0);
- Console.WriteLine($"{price:f2}");
- }
- else
- {
- Console.WriteLine($"{price:f2}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement