Advertisement
IvanITD

05.Journey

Jan 18th, 2024
907
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.31 KB | Source Code | 0 0
  1. double budget = double.Parse(Console.ReadLine());
  2. string twoSeason = Console.ReadLine();
  3.  
  4. string destination = "";
  5. string vacationType = "";
  6. double percentFromBudget = 0.00;
  7.  
  8. if (twoSeason == "summer")
  9. {
  10.     if (budget <= 100)
  11.     {
  12.         destination = "Bulgaria";
  13.         vacationType = "Camp";
  14.         percentFromBudget = budget - (budget * 0.30);
  15.     }
  16.     else if (budget <= 1000)
  17.     {
  18.         destination = "Balkans";
  19.         vacationType = "Camp";
  20.         percentFromBudget = budget - (budget * 0.40);
  21.     }
  22.     else if (budget > 1000)
  23.     {
  24.         destination = "Europe";
  25.         vacationType = "Hotel";
  26.         percentFromBudget = budget - (budget * 0.90);
  27.     }
  28. }
  29. else if (twoSeason == "winter")
  30. {
  31.     if (budget <= 100)
  32.     {
  33.         destination = "Bulgaria";
  34.         vacationType = "Hotel";
  35.         percentFromBudget = budget - (budget * 0.70);
  36.     }
  37.     else if (budget <= 1000)
  38.     {
  39.         destination = "Balkans";
  40.         vacationType = "Hotel";
  41.         percentFromBudget = budget - (budget * 0.80);
  42.     }
  43.     else if (budget > 1000)
  44.     {
  45.         destination = "Europe";
  46.         vacationType = "Hotel";
  47.         percentFromBudget = budget - (budget * 0.90);
  48.     }
  49. }
  50.  
  51. Console.WriteLine($"Somewhere in {destination} \n{vacationType} - {budget - percentFromBudget:F2}");
Tags: C#
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement