Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Exam2
- {
- class Program
- {
- static void Main(string[] args)
- {
- var dancersCount = int.Parse(Console.ReadLine());
- var points = double.Parse(Console.ReadLine());
- var season = Console.ReadLine();
- var place = Console.ReadLine();
- Boolean flag = true;
- double resolution = 0.0;
- switch (place)
- {
- case "Bulgaria":
- resolution = dancersCount * points;
- break;
- case "Abroad":
- resolution = dancersCount * points;
- resolution = resolution + (resolution / 2);
- flag = false;
- break;
- default:
- Console.WriteLine("Values can be only 'Bulgaria' and 'Abroad'.");
- return;
- }
- double totalSum = resolution;
- if (season == "summer" && flag)
- {
- totalSum -= totalSum * 0.05;
- } else if (season == "summer" && !flag)
- {
- totalSum -= totalSum * 0.10;
- } else if (season == "winter" && flag)
- {
- totalSum -= totalSum * 0.08;
- } else
- {
- totalSum -= totalSum * 0.15;
- }
- double forCharity = totalSum * 0.75;
- totalSum -= forCharity;
- totalSum /= dancersCount;
- Console.WriteLine($"Charity - {forCharity:F2}\nMoney per dancer - {totalSum:F2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement