knikolov98

Untitled

Sep 17th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.73 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Roadtrip
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.  
  10.             double initbudget = double.Parse(Console.ReadLine());
  11.             double budget = initbudget;
  12.             string season = Console.ReadLine();
  13.             string destination = string.Empty;
  14.             string rest = string.Empty;
  15.  
  16.             if (budget <= 100)
  17.  
  18.             {
  19.                 if (season == "summer")
  20.                 {
  21.                     budget -= budget * 0.30;
  22.                     rest = "Camp";
  23.                 }
  24.                 else if (season == "winter")
  25.                 {
  26.                     budget -= budget * 0.70;
  27.                     rest = "Hotel";
  28.                 }
  29.                 destination = "Bulgaria";
  30.  
  31.             }
  32.  
  33.             else if (budget <= 1000)
  34.             {
  35.                 if (season == "summer")
  36.                 {
  37.                     budget -= budget * 0.4;
  38.                     rest = "Camp";
  39.                 }
  40.  
  41.                 else if (season == "winter")
  42.                 {
  43.                     budget -= budget * 0.8;
  44.                     rest = "Hotel";
  45.                 }
  46.                 destination = "Balkans";
  47.             }
  48.  
  49.             else if (budget > 1000)
  50.             {
  51.                 budget -= budget * 0.9;
  52.  
  53.                 /*if (season == "summer")
  54.                     rest = "Camp";
  55.                 else if (season == "winter")*/
  56.                     rest = "Hotel";
  57.                 destination = "Europe";
  58.             }
  59.  
  60.             double moneyspent = initbudget - budget;
  61.  
  62.             Console.WriteLine($"Somewhere in {destination}");
  63.             Console.WriteLine($"{rest} - {moneyspent:f2}");
  64.  
  65.         }
  66.     }
  67. }
Add Comment
Please, Sign In to add comment