Advertisement
Guest User

Untitled

a guest
Oct 31st, 2019
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.89 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _3_zad
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string partOfChampionship = Console.ReadLine();
  10.             string typeTicket = Console.ReadLine();
  11.             int numberoftickets = int.Parse(Console.ReadLine());
  12.             char photo = char.Parse(Console.ReadLine());
  13.             double ticketPrice = 0;
  14.             double photowithtrophy = 40;
  15.             if (partOfChampionship == "Quarter final")
  16.             {
  17.                 if (typeTicket == "Standard")
  18.                 {
  19.                     ticketPrice = 55.50;
  20.                 }
  21.                 else if (typeTicket == "Premium")
  22.                 {
  23.                     ticketPrice = 105.20;
  24.                 }
  25.                 else if (typeTicket == "VIP")
  26.                 {
  27.                     ticketPrice = 118.90;
  28.                 }
  29.             }
  30.             else if (partOfChampionship == "Semi final")
  31.             {
  32.                 if (typeTicket == "Standard")
  33.                 {
  34.                     ticketPrice = 75.88;
  35.                 }
  36.                 else if (typeTicket == "Premium")
  37.                 {
  38.                     ticketPrice = 125.22;
  39.                 }
  40.                 else if (typeTicket == "VIP")
  41.                 {
  42.                     ticketPrice = 300.40;
  43.                 }
  44.             }
  45.             else if (partOfChampionship == "Final")
  46.             {
  47.                 if (typeTicket == "Standard")
  48.                 {
  49.                     ticketPrice = 110.10;
  50.                 }
  51.                 else if (typeTicket == "Premium")
  52.                 {
  53.                     ticketPrice = 160.66;
  54.                 }
  55.                 else if (typeTicket == "VIP")
  56.                 {
  57.                     ticketPrice = 400;
  58.                 }
  59.             }
  60.             double totalMoney = ticketPrice * numberoftickets;
  61.             if (totalMoney >= 4000)
  62.             {
  63.                 totalMoney = totalMoney * 0.75;
  64.                 photowithtrophy = 0;
  65.             }
  66.             else if (totalMoney >= 2500)
  67.             {
  68.                 totalMoney = totalMoney * 0.9;
  69.                 if (photo == 'Y')
  70.                 {
  71.                     photowithtrophy = numberoftickets * 40;
  72.                 }
  73.             }
  74.             if (photo == 'Y')
  75.             {
  76.                 if (totalMoney >= 4000)
  77.                 {
  78.                     Console.WriteLine($"{totalMoney:f2}");
  79.                 }
  80.                 else if (totalMoney >= 2500)
  81.                 {
  82.                     Console.WriteLine($"{totalMoney + photowithtrophy:F2}");
  83.                 }
  84.                 else
  85.                 {
  86.                     Console.WriteLine($"{totalMoney+ photowithtrophy:f2}");
  87.                 }
  88.             }
  89.             else if (photo == 'N')
  90.             {
  91.                 Console.WriteLine($"{totalMoney:f2}");
  92.             }
  93.         }
  94.     }
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement