silviasj

journey

Mar 19th, 2020
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.09 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 budjet = double.Parse(Console.ReadLine());
  10.             string season = Console.ReadLine();
  11.  
  12.             string destination = "";
  13.             double price = 0;
  14.             string accommodation = "";
  15.  
  16.             switch (season)
  17.             {
  18.                 case "Summer":
  19.                     if (budjet <= 100)
  20.                     {
  21.                         destination = "Bulgaria";
  22.                         accommodation = "Camp";
  23.                         price = budjet * 0.30;
  24.                     }
  25.                     else if (budjet > 100 && budjet <= 1000)
  26.                     {
  27.                         destination = "Balkans";
  28.                         accommodation = "Camp";
  29.                         price = budjet * 0.40;
  30.                     }
  31.                     else if (budjet > 1000)
  32.                     {
  33.                         destination = "Europe";
  34.                         accommodation = "Camp";
  35.                         price = budjet * 0.90;
  36.                     }
  37.                     break;
  38.                 case "Winter":
  39.                     if (budjet <= 100)
  40.                     {
  41.                         destination = "Bulgaria";
  42.                         accommodation = "Hotel";
  43.                         price = budjet * 0.70;
  44.                     }
  45.                     else if (budjet <= 1000)
  46.                     {
  47.                         destination = "Balkans";
  48.                         accommodation = "Hotel";
  49.                         price = budjet * 0.80;
  50.                     }
  51.                     else if (budjet > 1000)
  52.                     {
  53.                         destination = "Europe";
  54.                         accommodation = "Hotel";
  55.                         price = budjet * 0.90;
  56.                     }
  57.                     Console.WriteLine($"Somewhere in {destination}");
  58.                     Console.WriteLine($"{accommodation} - {price:f2}");
  59.                     break;
  60.  
  61.             }
  62.  
  63.            
  64.  
  65.         }
  66.     }
  67. }
Add Comment
Please, Sign In to add comment