Anzzhhela98

а

May 24th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.45 KB | None | 0 0
  1. using System;
  2.  
  3. namespace dddd
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             //вход в конзолата - буджет, сезон
  10.             double moneyHave = double.Parse(Console.ReadLine());
  11.             string season = Console.ReadLine();
  12.             double spendMoney = 0;
  13.  
  14.             //изчисляване ако има 100< някъде в България
  15.             // Лято – 30% от бюджета
  16.             //Зима – 70 % от бюджета
  17.             if (moneyHave <= 100)
  18.             {
  19.                 Console.WriteLine("Somewhere in Bulgaria");
  20.                 if (season == "summer")
  21.                 {
  22.                      spendMoney = moneyHave * 0.3;
  23.                     Console.WriteLine($"Camp - {spendMoney:f2}");
  24.                 }
  25.                 else if (season == "winer" )
  26.                 {
  27.                     spendMoney = moneyHave * 0.7;
  28.                     Console.WriteLine($"Hotel - {spendMoney:f2}");
  29.                 }
  30.             }
  31.             if (moneyHave > 100 && moneyHave <=1000)
  32.             {
  33.                 Console.WriteLine("Somewhere in Balkans");
  34.                  if  (season == "summer")
  35.                 {
  36.                     spendMoney = moneyHave * 0.4;
  37.                     Console.WriteLine($"Camp -  {spendMoney:f2}");
  38.                 }
  39.                 else if (season == "winter")
  40.                 {
  41.                     spendMoney = moneyHave * 0.8;
  42.                     Console.WriteLine($"Hotel - {spendMoney:f2}");
  43.                 }
  44.             }
  45.  
  46.             if (moneyHave > 1000)
  47.             {
  48.                 Console.WriteLine("Somewhere in Europe");
  49.                 spendMoney = moneyHave * 0.9;
  50.                 Console.WriteLine($" Hotel - {spendMoney:f2}");
  51.             }
  52.         }
  53.     }
  54. }
  55.  
  56. //изчисляване ако има 1000лв. или по малко – някъде на Балканите
  57. //Лято – 40% от бюджетаo Зима – 80 % от бюджета
  58.  
  59. //ако има повече от 1000лв. – някъде из Европа
  60. //При пътуване из Европа, независимо от сезона ще похарчи 90 % от бюджета.
  61.  
  62. // Първи ред – „Somewhere in [дестинация]“ измежду “Bulgaria&quot;, &quot;Balkans” и ”Europe”
  63. //Втори ред – “{ Вид почивка} – { Похарчена сума}“
Add Comment
Please, Sign In to add comment