Advertisement
silvana1303

film premiere

Apr 30th, 2020
683
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.82 KB | None | 0 0
  1. using System;
  2.  
  3. namespace exampreparation
  4. {
  5.     class exam
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string projection = Console.ReadLine();
  10.             string food = Console.ReadLine();
  11.             int tickets = int.Parse(Console.ReadLine());
  12.             int price = 0;
  13.  
  14.             if (projection == "John Wick")
  15.             {
  16.                 if (food == "Drink")
  17.                 {
  18.                     price = 12;
  19.                 }
  20.                 else if (food == "Popcorn")
  21.                 {
  22.                     price = 15;
  23.                 }
  24.                 else
  25.                 {
  26.                     price = 19;
  27.                 }
  28.             }
  29.             else if (projection == "Star Wars")
  30.             {
  31.                 if (food == "Drink")
  32.                 {
  33.                     price = 18;
  34.                 }
  35.                 else if (food == "Popcorn")
  36.                 {
  37.                     price = 25;
  38.                 }
  39.                 else
  40.                 {
  41.                     price = 30;
  42.                 }
  43.             }
  44.             else if (projection == "Jumanji")
  45.             {
  46.                 if (food == "Drink")
  47.                 {
  48.                     price = 9;
  49.                 }
  50.                 else if (food == "Popcorn")
  51.                 {
  52.                     price = 11;
  53.                 }
  54.                 else
  55.                 {
  56.                     price = 14;
  57.                 }
  58.             }
  59.  
  60.             double sum = price * tickets;
  61.  
  62.             if (projection == "Star Wars" && tickets >= 4)
  63.             {
  64.                 sum *= 0.70;
  65.             }
  66.             if (projection == "Jumanji" && tickets == 2)
  67.             {
  68.                 sum *= 0.85;
  69.             }
  70.  
  71.             Console.WriteLine($"Your bill is {sum:f2} leva.");
  72.         }
  73.     }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement