Advertisement
silvana1303

journey

Mar 29th, 2020
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.46 KB | None | 0 0
  1. using System;
  2.  
  3. namespace homeworkconditional
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double budget = double.Parse(Console.ReadLine());
  10.             string season = Console.ReadLine();
  11.             string destination = "";
  12.             string overnight = "";
  13.             double price = 0.0;
  14.  
  15.             if (budget <= 100)
  16.             {
  17.                 destination = "Bulgaria";
  18.  
  19.                 if (season == "summer")
  20.                 {
  21.                     overnight = "Camp";
  22.                     price = budget * 0.3;
  23.                 }
  24.                 else
  25.                 {
  26.                     overnight = "Hotel";
  27.                     price = budget * 0.7;
  28.                 }
  29.             }
  30.             else if (budget <= 1000)
  31.             {
  32.                 destination = "Balkans";
  33.  
  34.                 if (season == "summer")
  35.                 {
  36.                     overnight = "Camp";
  37.                     price = budget * 0.4;
  38.                 }
  39.                 else
  40.                 {
  41.                     overnight = "Hotel";
  42.                     price = budget * 0.8;
  43.                 }
  44.             }
  45.             else
  46.             {
  47.                 destination = "Europe";
  48.                 overnight = "Hotel";
  49.                 price = budget * 0.90;
  50.             }
  51.  
  52.             Console.WriteLine($"Somewhere in {destination}");
  53.             Console.WriteLine($"{overnight} - {price:f2}");
  54.         }
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement