Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.18 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _03.Trip
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var budget = double.Parse(Console.ReadLine());
  14.             var season = Console.ReadLine();
  15.             var spentMoney = 0.0;
  16.             var vacation = "";
  17.             var country = "";
  18.  
  19.             if (budget<=100)
  20.             {
  21.                 switch (season)
  22.                 {
  23.                     case "summer":
  24.                         spentMoney = budget * 0.3;
  25.                         vacation = "Camp";
  26.                         country = "Bulgaria";
  27.                         break;
  28.                     case "winter":
  29.                         spentMoney = budget * 0.7;
  30.                         vacation = "Hotel";
  31.                         country = "Bulgaria";
  32.                         break;
  33.                 }
  34.             }
  35.             else if (budget <= 1000)
  36.             {
  37.                 switch (season)
  38.                 {
  39.                     case "summer":
  40.                         spentMoney = budget * 0.4;
  41.                         vacation = "Camp";
  42.                         country = "Balkans";
  43.                         break;
  44.                     case "winter":
  45.                         spentMoney = budget * 0.8;
  46.                         vacation = "Hotel";
  47.                         country = "Balkans";
  48.                         break;
  49.                 }
  50.             }
  51.             else
  52.             {
  53.                 switch (season)
  54.                 {
  55.                     case "summer":
  56.                         spentMoney = budget * 0.9;
  57.                         vacation = "Hotel";
  58.                         country = "Europe";
  59.                         break;
  60.                     case "winter":
  61.                         spentMoney = budget * 0.9;
  62.                         vacation = "Hotel";
  63.                         country = "Europe";
  64.                         break;
  65.                 }
  66.             }
  67.             Console.WriteLine("Somewhere in {0}", country);
  68.             Console.WriteLine("{0} - {1:f2}", vacation, spentMoney);
  69.         }
  70.     }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement