Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace DomashnoJorney
- {
- class Program
- {
- static void Main(string[] args)
- {
- // get input --> budget and season ( summer / winter )
- double budget = double.Parse(Console.ReadLine());
- string season = Console.ReadLine().ToLower();
- // decide destinatiom, according to budget; --> Bulgaria / Balkans / Europe
- string destination = "0";
- double summerBudgetPercent = 0.00;
- double winterBudgetPercent = 0.00;
- if (budget <= 100)
- {
- destination = "Bulgaria";
- summerBudgetPercent = 30;
- winterBudgetPercent = 70;
- }
- else if (budget <= 1000)
- {
- destination = "Balkans";
- summerBudgetPercent = 40;
- winterBudgetPercent = 80;
- }
- else
- {
- destination = "Europe";
- summerBudgetPercent = 90;
- winterBudgetPercent = 90;
- }
- // decide typeSettel, according to season and destination --> Camp / Hotel
- string typeSettle = "0";
- if (destination == "Europe")
- {
- typeSettle = "Hotel";
- }
- else
- {
- switch (season)
- {
- case "summer":
- typeSettle = "Camp";
- break;
- case "winter":
- typeSettle = "Hotel";
- break;
- }
- }
- // calculate moneySpent, according to destination and season
- double moneySpent = 0.00;
- if (destination == "Europe")
- {
- moneySpent = budget * (1.00 * summerBudgetPercent / 100);
- }
- else
- {
- switch (season)
- {
- case "summer":
- moneySpent = budget * (1.00 * summerBudgetPercent / 100);
- break;
- case "winter":
- moneySpent = budget * (1.00 * winterBudgetPercent / 100);
- break;
- }
- }
- // print --> „Somewhere in [дестинация]“ ; “{Вид почивка} – {Похарчена сума}“
- Console.WriteLine($"Somewhere in {destination}");
- Console.WriteLine($"{typeSettle} - {moneySpent:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement