Advertisement
silvana1303

oscars week in cinema

Apr 29th, 2020
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.09 KB | None | 0 0
  1. using System;
  2.  
  3. namespace exampreparation
  4.  
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             string movie = Console.ReadLine();
  11.             string hallType = Console.ReadLine();
  12.             int tickets = int.Parse(Console.ReadLine());
  13.             double ticketPrice = 0.0;
  14.  
  15.             if (movie == "A Star Is Born")
  16.             {
  17.                 if (hallType == "normal")
  18.                 {
  19.                     ticketPrice = 7.50;
  20.                 }
  21.                 else if (hallType == "luxury")
  22.                 {
  23.                     ticketPrice = 10.50;
  24.                 }
  25.                 else
  26.                 {
  27.                     ticketPrice = 13.50;
  28.                 }
  29.             }
  30.             else if (movie == "Bohemian Rhapsody")
  31.             {
  32.                 if (hallType == "normal")
  33.                 {
  34.                     ticketPrice = 7.35;
  35.                 }
  36.                 else if (hallType == "luxury")
  37.                 {
  38.                     ticketPrice = 9.45;
  39.                 }
  40.                 else
  41.                 {
  42.                     ticketPrice = 12.75;
  43.                 }
  44.             }
  45.             else if (movie == "Green Book")
  46.             {
  47.                 if (hallType == "normal")
  48.                 {
  49.                     ticketPrice = 8.15;
  50.                 }
  51.                 else if (hallType == "luxury")
  52.                 {
  53.                     ticketPrice = 10.25;
  54.                 }
  55.                 else
  56.                 {
  57.                     ticketPrice = 13.25;
  58.                 }
  59.             }
  60.             else
  61.             {
  62.                 if (hallType == "normal")
  63.                 {
  64.                     ticketPrice = 8.75;
  65.                 }
  66.                 else if (hallType == "luxury")
  67.                 {
  68.                     ticketPrice = 11.55;
  69.                 }
  70.                 else
  71.                 {
  72.                     ticketPrice = 13.95;
  73.                 }
  74.             }
  75.  
  76.             double sum = ticketPrice * tickets;
  77.  
  78.             Console.WriteLine($"{movie} -> {sum:f2} lv.");
  79.         }
  80.     }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement