Advertisement
silvana1303

vacantion

Mar 26th, 2020
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.62 KB | None | 0 0
  1. using System;
  2.  
  3. namespace morexercies
  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 place = "";
  12.             var price = 0.0;
  13.             var location = "";
  14.  
  15.             if (budget <= 1000)
  16.             {
  17.                 place = "Camp";
  18.  
  19.                 if (season == "Summer")
  20.                 {
  21.                     location = "Alaska";
  22.                     price = budget * 0.65;
  23.                 }
  24.                 else
  25.                 {
  26.                     location = "Morocco";
  27.                     price = budget * 0.45;
  28.                 }
  29.             }
  30.             else if (budget > 1000 && budget <= 3000)
  31.             {
  32.                 place = "Hut";
  33.  
  34.                 if (season == "Summer")
  35.                 {
  36.                     location = "Alaska";
  37.                     price = budget * 0.80;
  38.                 }
  39.                 else
  40.                 {
  41.                     location = "Morocco";
  42.                     price = budget * 0.60;
  43.                 }
  44.             }
  45.             else
  46.             {
  47.                 place = "Hotel";
  48.  
  49.                 if (season == "Summer")
  50.                 {
  51.                     location = "Alaska";
  52.                     price = budget * 0.90;
  53.                 }
  54.                 else
  55.                 {
  56.                     location = "Morocco";
  57.                     price = budget * 0.90;
  58.                 }
  59.             }
  60.  
  61.             Console.WriteLine($"{location} - {place} - {price:f2}");
  62.  
  63.         }
  64.     }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement