Advertisement
svephoto

Journey [C#]

Feb 26th, 2021
1,244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.55 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Journey
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double budget = double.Parse(Console.ReadLine());
  10.             string season = Console.ReadLine();
  11.  
  12.             string destination = string.Empty;
  13.             string typeOfTrip = string.Empty;
  14.  
  15.             double priceForTrip = 0;
  16.  
  17.             if (budget <= 100)
  18.             {
  19.                 destination = "Bulgaria";
  20.  
  21.                 if (season.Equals("summer"))
  22.                 {
  23.                     priceForTrip = budget * 0.3;
  24.                     typeOfTrip = "Camp";
  25.                 }
  26.                 else
  27.                 {
  28.                     priceForTrip = budget * 0.7;
  29.                     typeOfTrip = "Hotel";
  30.                 }
  31.             }
  32.             else if (budget <= 1000)
  33.             {
  34.                 destination = "Balkans";
  35.  
  36.                 if (season.Equals("summer"))
  37.                 {
  38.                     priceForTrip = budget * 0.4;
  39.                     typeOfTrip = "Camp";
  40.                 }
  41.                 else
  42.                 {
  43.                     priceForTrip = budget * 0.8;
  44.                     typeOfTrip = "Hotel";
  45.                 }
  46.             }
  47.             else
  48.             {
  49.                 destination = "Europe";
  50.  
  51.                 priceForTrip = budget * 0.9;
  52.                 typeOfTrip = "Hotel";                
  53.             }
  54.  
  55.             Console.WriteLine($"Somewhere in {destination}");
  56.             Console.WriteLine($"{typeOfTrip} - {priceForTrip:F2}");
  57.         }
  58.     }
  59. }
  60.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement