Advertisement
Alexander_B

Journey

Feb 3rd, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 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 DomashnoJorney
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. // get input --> budget and season ( summer / winter )
  14.  
  15. double budget = double.Parse(Console.ReadLine());
  16. string season = Console.ReadLine().ToLower();
  17.  
  18. // decide destinatiom, according to budget; --> Bulgaria / Balkans / Europe
  19.  
  20. string destination = "0";
  21. double summerBudgetPercent = 0.00;
  22. double winterBudgetPercent = 0.00;
  23.  
  24. if (budget <= 100)
  25. {
  26. destination = "Bulgaria";
  27. summerBudgetPercent = 30;
  28. winterBudgetPercent = 70;
  29. }
  30. else if (budget <= 1000)
  31. {
  32. destination = "Balkans";
  33. summerBudgetPercent = 40;
  34. winterBudgetPercent = 80;
  35. }
  36. else
  37. {
  38. destination = "Europe";
  39. summerBudgetPercent = 90;
  40. winterBudgetPercent = 90;
  41. }
  42.  
  43. // decide typeSettel, according to season and destination --> Camp / Hotel
  44.  
  45. string typeSettle = "0";
  46.  
  47. if (destination == "Europe")
  48. {
  49. typeSettle = "Hotel";
  50. }
  51. else
  52. {
  53. switch (season)
  54. {
  55. case "summer":
  56. typeSettle = "Camp";
  57. break;
  58. case "winter":
  59. typeSettle = "Hotel";
  60. break;
  61. }
  62. }
  63.  
  64. // calculate moneySpent, according to destination and season
  65.  
  66. double moneySpent = 0.00;
  67.  
  68. if (destination == "Europe")
  69. {
  70. moneySpent = budget * (1.00 * summerBudgetPercent / 100);
  71. }
  72. else
  73. {
  74. switch (season)
  75. {
  76. case "summer":
  77. moneySpent = budget * (1.00 * summerBudgetPercent / 100);
  78. break;
  79. case "winter":
  80. moneySpent = budget * (1.00 * winterBudgetPercent / 100);
  81. break;
  82. }
  83. }
  84.  
  85. // print --> „Somewhere in [дестинация]“ ; “{Вид почивка} – {Похарчена сума}“
  86.  
  87. Console.WriteLine($"Somewhere in {destination}");
  88. Console.WriteLine($"{typeSettle} - {moneySpent:f2}");
  89. }
  90. }
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement