Advertisement
desislava_topuzakova

05. Journey

Jun 20th, 2021
859
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.96 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _05._Journey
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             //дестинация зависи от бюджета - OK
  10.             //вид на почивката зависи от сезона
  11.             //похарчена сума зависи от бюджета и сезона
  12.  
  13.             double budget = double.Parse(Console.ReadLine());
  14.             string season = Console.ReadLine(); //„summer” или “winter”
  15.  
  16.             string destination = "";
  17.             string type = "";
  18.             double spendMoney = 0;
  19.  
  20.             //проверка за бюджета
  21.             if (budget <= 100)
  22.             {
  23.                 destination = "Bulgaria";
  24.                 //проверка за сезона
  25.                 if(season == "summer")
  26.                 {
  27.                     spendMoney = 0.30 * budget;
  28.                     type = "Camp";
  29.                 }
  30.                 else if (season == "winter")
  31.                 {
  32.                     spendMoney = 0.70 * budget;
  33.                     type = "Hotel";
  34.                 }
  35.  
  36.             }
  37.             else if (budget <= 1000)
  38.             {
  39.                 destination = "Balkans";
  40.                 //проверка за сезона
  41.                 if (season == "summer")
  42.                 {
  43.                     spendMoney = 0.40 * budget;
  44.                     type = "Camp";
  45.                 }
  46.                 else if (season == "winter")
  47.                 {
  48.                     spendMoney = 0.80 * budget;
  49.                     type = "Hotel";
  50.                 }
  51.             }
  52.             else if (budget > 1000)
  53.             {
  54.                 destination = "Europe";
  55.                 spendMoney = 0.90 * budget;
  56.                 type = "Hotel";
  57.             }
  58.  
  59.             Console.WriteLine($"Somewhere in {destination}");
  60.             Console.WriteLine($"{type} - {spendMoney:F2}");
  61.  
  62.         }
  63.        
  64.     }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement