Advertisement
Pazzobg

Programming Basics / 4.Complex-Conditions/16.Trip

Feb 10th, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.56 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.             double budget = double.Parse(Console.ReadLine());
  10.             string season = Console.ReadLine();
  11.             double expence = 0.00;
  12.             string destination = "a";
  13.             string accomodation = "a";
  14.             if (budget <= 100)
  15.             {
  16.                 destination = "Bulgaria";
  17.  
  18.                 if (season == "summer")
  19.                 {
  20.                     accomodation = "Camp";
  21.                     expence = budget * 0.30;
  22.                 }
  23.                 else if (season == "winter")
  24.                 {
  25.                     accomodation = "Hotel";
  26.                     expence = budget * 0.70;
  27.                 }
  28.             }
  29.             else if (budget <= 1000)
  30.             {
  31.                 destination = "Balkans";
  32.  
  33.                 if (season == "summer")
  34.                 {
  35.                     accomodation = "Camp";
  36.                     expence = budget * 0.40;
  37.                 }
  38.                 else if (season == "winter")
  39.                 {
  40.                     accomodation = "Hotel";
  41.                     expence = budget * 0.80;
  42.                 }
  43.             }
  44.             else if (budget > 1000)
  45.             {
  46.                 destination = "Europe";
  47.                 accomodation = "Hotel";
  48.                 expence = budget * 0.90;
  49.             }
  50.             Console.WriteLine($"Somewhere in {destination}");
  51.             Console.WriteLine("{0} - {1:f2}", accomodation, expence);
  52.         }
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement