Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Задача 6.Пътешествие от упражнението за вложени условни конструкции
- using System;
- namespace NestedIfs
- {
- class Program
- {
- static void Main()
- {
- double budget = double.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- string destitantion = String.Empty;
- string accomudation = String.Empty;
- if (budget <= 100)
- {
- destitantion = "Bulgaria";
- if (season == "summer")
- {
- accomudation = "Camp";
- budget *= 0.3;
- }
- else if (season == "winter")
- {
- budget *= 0.7;
- accomudation = "Hotel";
- }
- }
- else if (budget <= 1000)
- {
- destitantion = "Balkans";
- if (season == "summer")
- {
- accomudation = "Camp";
- budget *= 0.4;
- }
- else if (season == "winter")
- {
- accomudation = "Hotel";
- budget *= 0.8;
- }
- }
- else if (budget > 1000)
- {
- accomudation = "Hotel";
- destitantion = "Europe";
- budget *= 0.9;
- }
- Console.WriteLine($"Somewhere in {destitantion}");
- Console.WriteLine($"{accomudation} - {budget:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement