Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _05._Journey
- {
- class Program
- {
- static void Main(string[] args)
- {
- //дестинация зависи от бюджета - OK
- //вид на почивката зависи от сезона
- //похарчена сума зависи от бюджета и сезона
- double budget = double.Parse(Console.ReadLine());
- string season = Console.ReadLine(); //„summer” или “winter”
- string destination = "";
- string type = "";
- double spendMoney = 0;
- //проверка за бюджета
- if (budget <= 100)
- {
- destination = "Bulgaria";
- //проверка за сезона
- if(season == "summer")
- {
- spendMoney = 0.30 * budget;
- type = "Camp";
- }
- else if (season == "winter")
- {
- spendMoney = 0.70 * budget;
- type = "Hotel";
- }
- }
- else if (budget <= 1000)
- {
- destination = "Balkans";
- //проверка за сезона
- if (season == "summer")
- {
- spendMoney = 0.40 * budget;
- type = "Camp";
- }
- else if (season == "winter")
- {
- spendMoney = 0.80 * budget;
- type = "Hotel";
- }
- }
- else if (budget > 1000)
- {
- destination = "Europe";
- spendMoney = 0.90 * budget;
- type = "Hotel";
- }
- Console.WriteLine($"Somewhere in {destination}");
- Console.WriteLine($"{type} - {spendMoney:F2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement