desislava_topuzakova

03. вариант 2

Dec 5th, 2021
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 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.  
  17. if (firmName == "Dogramichka4You")
  18. {
  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. }
  32. else if (firmName == "TihoToplo")
  33. {
  34. if (countCameras == 3)
  35. {
  36. price = 15;
  37. }
  38. else if (countCameras == 4)
  39. {
  40. price = 14;
  41. }
  42. else if (countCameras == 5)
  43. {
  44. price = 18;
  45. }
  46. }
  47. else if (firmName == "ChukChuk")
  48. {
  49. if (countCameras == 3)
  50. {
  51. price = 14;
  52. }
  53. else if (countCameras == 4)
  54. {
  55. price = 20;
  56. }
  57. else if (countCameras == 5)
  58. {
  59. price = 22;
  60. }
  61. }
  62.  
  63.  
  64. double totalPrice = area * price;
  65. Console.WriteLine($"Goshko has to spend {totalPrice:F2} leva.");
  66.  
  67.  
  68. }
  69. }
  70. }
  71.  
Advertisement
Add Comment
Please, Sign In to add comment