Advertisement
denitsas01

Untitled

Mar 29th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.64 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 journey1
  8. {
  9.     class journey
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double budget = double.Parse(Console.ReadLine());
  14.             string season = Console.ReadLine();
  15.             string destination = string.Empty;
  16.             string place = string.Empty;
  17.             double price = 0;
  18.  
  19.             if (budget <= 100)
  20.             {
  21.                 destination = "Bulgaria";
  22.                 if (season == "summer")
  23.                 {
  24.                     place = "camp";
  25.                     price = budget - (0.3 * budget);
  26.                 }
  27.                 else if (season == "winter")
  28.                 {
  29.                     place = "hotel";
  30.                     price = budget - (0.7 * budget);
  31.                 }
  32.             }
  33.             else if (budget <= 1000)
  34.             {
  35.                 destination = "Balkans";
  36.                 if (season == "summer")
  37.                 {
  38.                     place = "camp";
  39.                     price = budget - (0.4 * budget);
  40.                 }
  41.                 else if (season == "winter")
  42.                 {
  43.                     place = "hotel";
  44.                     price = budget - (0.8 * budget);
  45.                 }
  46.             }
  47.             else if (budget > 1000)
  48.             {
  49.                 destination = "Europe";
  50.                 price = budget - (0.9 * budget);
  51.             }
  52.             Console.WriteLine($"Somewhere in {destination}");
  53.             Console.WriteLine($"{place} - {Math.Round(price,2)}");
  54.         }
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement