Advertisement
GeorgiGanev

asfasf

Jun 16th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Series
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. double budget = int.Parse(Console.ReadLine());
  10. double b = budget;
  11. double moviesCount = double.Parse(Console.ReadLine());
  12. string movieName = string.Empty;
  13. double moviePrice = 0;
  14. double thrones = 50;
  15. double lucifer = 40;
  16. double protector = 30;
  17. double totalDrama = 20;
  18. double area = 10;
  19.  
  20. double sum = 0;
  21.  
  22. for (int i = 0; i < moviesCount; i++)
  23. {
  24. movieName = Console.ReadLine();
  25. moviePrice = double.Parse(Console.ReadLine());
  26. switch (movieName)
  27. {
  28. case "Thrones":
  29. budget -= moviePrice - (moviePrice * 50) / 100;
  30. sum += moviePrice - (moviePrice * 50) / 100;
  31. break;
  32. case "Lucifer":
  33. budget -= moviePrice - (moviePrice * 40) / 100;
  34. sum += moviePrice - (moviePrice * 40) / 100;
  35. break;
  36. case "Protector":
  37. budget -= moviePrice - (moviePrice * 30) / 100;
  38. sum += moviePrice - (moviePrice * 30) / 100;
  39. break;
  40. case "TotalDrama":
  41. budget -= moviePrice - (moviePrice * 20) / 100;
  42. sum += moviePrice - (moviePrice * 20) / 100;
  43. break;
  44. case "Area":
  45. budget -= moviePrice - (moviePrice * 10) / 100;
  46. sum += moviePrice - (moviePrice * 10) / 100;
  47. break;
  48. default:
  49. budget -= moviePrice;
  50. sum += moviePrice;
  51. break;
  52. }
  53.  
  54. }
  55.  
  56. if (b >= sum)
  57. {
  58. Console.WriteLine($"You bought all the series and left with {budget:F2} lv.");
  59. }
  60. else
  61. {
  62. Console.WriteLine($"You need {sum - b:F2} lv. more to buy the series!");
  63. }
  64. }
  65. }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement