deleriumbg

Final Competition

Apr 12th, 2018
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.41 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Final_Competition
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int dancers = int.Parse(Console.ReadLine());
  10.             double points = double.Parse(Console.ReadLine());
  11.             string season = Console.ReadLine();
  12.             string location = Console.ReadLine();
  13.  
  14.             double award = dancers * points;
  15.             if (location == "Abroad")
  16.             {
  17.                 award *= 1.5;
  18.             }
  19.             switch (location)
  20.             {
  21.                 case "Bulgaria":
  22.                     if (season == "summer")
  23.                     {
  24.                         award *= 0.95;
  25.                     }
  26.                     else if (season == "winter")
  27.                     {
  28.                         award *= 0.92;
  29.                     }
  30.                     break;
  31.                 case "Abroad":
  32.                     if (season == "summer")
  33.                     {
  34.                         award *= 0.90;
  35.                     }
  36.                     else if (season == "winter")
  37.                     {
  38.                         award *= 0.85;
  39.                     }
  40.                     break;
  41.             }
  42.             double charity = award * 0.75;
  43.             double moneyPerDancer = (award * 0.25) / dancers;
  44.             Console.WriteLine($"Charity - {charity:f2}\r\nMoney per dancer - {moneyPerDancer:f2}");
  45.         }
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment