desislava_topuzakova

3 -> вариант 1

Dec 5th, 2021
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _03
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. double width = double.Parse(Console.ReadLine());
  10. double length = double.Parse(Console.ReadLine());
  11. int countCameras = int.Parse(Console.ReadLine());
  12. string firmName = Console.ReadLine();
  13.  
  14. double area = width * length;
  15. double price = 0;
  16. switch(firmName)
  17. {
  18. case "Dogramichka4You":
  19. if (countCameras == 3)
  20. {
  21. price = 12;
  22. }
  23. else if (countCameras == 4)
  24. {
  25. price = 15;
  26. }
  27. else if (countCameras == 5)
  28. {
  29. price = 20;
  30. }
  31. break;
  32. case "TihoToplo":
  33. if (countCameras == 3)
  34. {
  35. price = 15;
  36. }
  37. else if (countCameras == 4)
  38. {
  39. price = 14;
  40. }
  41. else if (countCameras == 5)
  42. {
  43. price = 18;
  44. }
  45. break;
  46. case "ChukChuk":
  47. if (countCameras == 3)
  48. {
  49. price = 14;
  50. }
  51. else if (countCameras == 4)
  52. {
  53. price = 20;
  54. }
  55. else if (countCameras == 5)
  56. {
  57. price = 22;
  58. }
  59. break;
  60. }
  61.  
  62. double totalPrice = area * price;
  63. Console.WriteLine($"Goshko has to spend {totalPrice:F2} leva.");
  64.  
  65.  
  66. }
  67. }
  68. }
  69.  
Advertisement
Add Comment
Please, Sign In to add comment