Advertisement
desislava_topuzakova

01. Cinema

May 15th, 2023
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _01._Cinema
  4. {
  5. internal class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string type = Console.ReadLine();
  10. int rows = int.Parse(Console.ReadLine());
  11. int cols = int.Parse(Console.ReadLine());
  12.  
  13. //1. общ брой на местата в кинозалата = общ брой закупени билети
  14. int countTickets = rows * cols;
  15.  
  16. //2. приход = бр. закупени билет * цена за билета
  17. //type -> серия от проверки за точни стойности
  18. //Premiere -> 12
  19. //Normal -> 7.5
  20. //Discount -> 5
  21.  
  22. double priceTicket = 0;
  23.  
  24. switch (type)
  25. {
  26. case "Premiere":
  27. priceTicket = 12;
  28. break;
  29. case "Normal":
  30. priceTicket = 7.50;
  31. break;
  32. case "Discount":
  33. priceTicket = 5;
  34. break;
  35. }
  36.  
  37. double profit = countTickets * priceTicket;
  38. Console.WriteLine($"{profit:F2} leva");
  39.  
  40. }
  41. }
  42. }
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement