Advertisement
Guest User

Untitled

a guest
Nov 9th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. //Задача 6.Пътешествие от упражнението за вложени условни конструкции
  2. using System;
  3.  
  4. namespace NestedIfs
  5. {
  6. class Program
  7. {
  8. static void Main()
  9. {
  10. double budget = double.Parse(Console.ReadLine());
  11. string season = Console.ReadLine();
  12. string destitantion = String.Empty;
  13. string accomudation = String.Empty;
  14.  
  15. if (budget <= 100)
  16. {
  17. destitantion = "Bulgaria";
  18. if (season == "summer")
  19. {
  20. accomudation = "Camp";
  21. budget *= 0.3;
  22. }
  23. else if (season == "winter")
  24. {
  25. budget *= 0.7;
  26. accomudation = "Hotel";
  27. }
  28.  
  29. }
  30. else if (budget <= 1000)
  31. {
  32. destitantion = "Balkans";
  33.  
  34. if (season == "summer")
  35. {
  36. accomudation = "Camp";
  37. budget *= 0.4;
  38. }
  39. else if (season == "winter")
  40. {
  41. accomudation = "Hotel";
  42. budget *= 0.8;
  43. }
  44. }
  45. else if (budget > 1000)
  46. {
  47. accomudation = "Hotel";
  48. destitantion = "Europe";
  49.  
  50. budget *= 0.9;
  51. }
  52. Console.WriteLine($"Somewhere in {destitantion}");
  53. Console.WriteLine($"{accomudation} - {budget:f2}");
  54. }
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement