M0Hk

Journey

Feb 25th, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.51 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _06.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 = "";
  13.             string placeToStay = "";
  14.             double price = 0;
  15.  
  16.             if(budget <= 100)
  17.             {
  18.                 destination = "Bulgaria";
  19.                 if(season == "summer")
  20.                 {
  21.                     placeToStay = "Camp";
  22.                     price = budget * 0.3;
  23.                 }
  24.                 else if(season == "winter")
  25.                 {
  26.                     placeToStay = "Hotel";
  27.                     price = budget * 0.7;
  28.                 }
  29.             }
  30.             else if(budget <= 1000)
  31.             {
  32.                 destination = "Balkans";
  33.                 if (season == "summer")
  34.                 {
  35.                     placeToStay = "Camp";
  36.                     price = 0.4 * budget;
  37.                 }
  38.                 else if (season == "winter")
  39.                 {
  40.                     placeToStay = "Hotel";
  41.                     price = 0.8 * budget;
  42.                 }
  43.             }
  44.             else
  45.             {
  46.                 destination = "Europe";
  47.                 placeToStay = "Hotel";
  48.                 price = 0.9 * budget;
  49.             }
  50.             Console.WriteLine($"Somewhere in {destination}");
  51.             Console.WriteLine($"{placeToStay} - {price:F2}");
  52.         }
  53.     }
  54. }
Add Comment
Please, Sign In to add comment