dbunalov

Trip

Jul 7th, 2016
64
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 _16.Trip
  4. {
  5.     class Trip
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var budget = double.Parse(Console.ReadLine());
  10.             var season = Console.ReadLine().ToLower();
  11.             var destination = ""; //Bulgaria, Balkans, Europe
  12.             var typeOfTrip = "";  //Camp, Hotel
  13.             var price = 0.00;
  14.  
  15.             if (budget <= 100 && season == "summer") //if budget less than 100
  16.             {
  17.                 destination = "Bulgaria";
  18.                 typeOfTrip = "Camp";
  19.                 price = budget * 0.30;
  20.             }
  21.             else if (budget <= 100 && season == "winter")
  22.             {
  23.                 destination = "Bulgaria";
  24.                 typeOfTrip = "Hotel";
  25.                 price = budget * 0.70;
  26.             }
  27.             else if ((budget <= 1000 && budget > 100) && season == "summer")
  28.             {
  29.                 destination = "Balkans";
  30.                 typeOfTrip = "Camp";
  31.                 price = budget * 0.40;
  32.             }
  33.             else if ((budget <= 1000 && budget > 100) && season == "winter")
  34.             {
  35.                 destination = "Balkans";
  36.                 typeOfTrip = "Hotel";
  37.                 price = budget * 0.80;
  38.             }
  39.             else
  40.             {
  41.                 destination = "Europe";
  42.                 typeOfTrip = "Hotel";
  43.                 price = budget * 0.90;
  44.             }
  45.             Console.WriteLine("Somewhere in "+destination);
  46.             Console.WriteLine(typeOfTrip+" - {0:0.00}",price);
  47.         }
  48.     }
  49. }
Add Comment
Please, Sign In to add comment