Yachkov

Journey

Jan 28th, 2021
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.30 KB | None | 0 0
  1. using System;
  2. using System.ComponentModel;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.ComponentModel.Design;
  5. using System.Globalization;
  6. using System.Reflection;
  7. using System.Runtime.ConstrainedExecution;
  8. using System.Security.Cryptography;
  9.  
  10. namespace SomeExcercises
  11. {
  12.     class Program
  13.     {
  14.         static void Main(string[] args)
  15.         {
  16.             double budget = double.Parse(Console.ReadLine());
  17.             string season = Console.ReadLine();
  18.             string destination = "";
  19.             string typeOfHoliday = "";
  20.  
  21.  
  22.             switch (season)
  23.             {
  24.                 case "summer":
  25.                     if (budget <= 100)
  26.                     {
  27.                         typeOfHoliday = "Camp";
  28.                         destination = "Bulgaria";
  29.                         budget = budget * 0.30;
  30.                     }
  31.                     else if (budget <= 1000)
  32.                     {
  33.                         typeOfHoliday = "Camp";
  34.                         destination = "Balkans";
  35.                         budget = budget * 0.40;
  36.                     }
  37.                     else if (budget > 1000)
  38.                     {
  39.                         typeOfHoliday = "Hotel";
  40.                         destination = "Europe";
  41.                         budget = budget * 0.90;
  42.                     }
  43.                     break;
  44.                 case "winter":
  45.                     if (budget <= 100)
  46.                     {
  47.                         typeOfHoliday = "Hotel";
  48.                         destination = "Bulgaria";
  49.                         budget = budget * 0.70;
  50.                     }
  51.                     else if (budget <= 1000)
  52.                     {
  53.                         typeOfHoliday = "Hotel";
  54.                         destination = "Balkans";
  55.                         budget = budget * 0.80;
  56.                     }
  57.                     else if (budget > 1000)
  58.                     {
  59.                         typeOfHoliday = "Hotel";
  60.                         destination = "Europe";
  61.                         budget = budget * 0.90;
  62.                     }
  63.                     break;
  64.                    
  65.             }
  66.             Console.WriteLine($"Somewhere in {destination}");
  67.             Console.WriteLine($"{typeOfHoliday} - {budget:f2}");
  68.         }
  69.     }
  70. }
  71.  
  72.  
  73.  
  74.  
Advertisement
Add Comment
Please, Sign In to add comment