Advertisement
Guest User

Untitled

a guest
Dec 16th, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Problem_03___Vacation
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14. double budget = double.Parse(Console.ReadLine());
  15. string season = Console.ReadLine();
  16.  
  17. var price = 0.0;
  18. string place = null;
  19. string location = null;
  20.  
  21. if (budget <= 1000)
  22. {
  23.  
  24. place = "Camp";
  25.  
  26. if (season == "Summer")
  27. {
  28. location = "Alaska";
  29. price = budget * 0.65;
  30. Math.Round(price, 2);
  31. }
  32.  
  33. else if (season == "Winter")
  34. {
  35. location = "Morocco ";
  36.  
  37. price = budget * 0.45;
  38. Math.Round(price, 2);
  39. }
  40. }
  41.  
  42. if ( budget > 1000 && budget <= 3000)
  43. {
  44. place = "Hut";
  45.  
  46. if (season == "Summer")
  47. {
  48. location = "Alaska";
  49. price = budget * 0.80;
  50. Math.Round(price, 2);
  51. }
  52.  
  53. else if (season == "Winter")
  54. {
  55. location = "Morocco";
  56. price = budget * 0.60;
  57. Math.Round(price, 2);
  58.  
  59. }
  60. }
  61. else if (budget > 3000)
  62. {
  63. place = "Hotel";
  64. price = budget * 0.90;
  65. Math.Round(price, 2);
  66. if (season == "Summer")
  67. {
  68. location = "Alaska";
  69. }
  70. else if (season == "Winter")
  71. {
  72. location = "Morocco";
  73. }
  74.  
  75. }
  76. Console.WriteLine($"{location} - {place} - {price:f2}");
  77.  
  78.  
  79. }
  80. }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement