RadoslavStamboliev

03. Final Competition

Jul 26th, 2017
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.53 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Final_Competition
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int numberDancer = int.Parse(Console.ReadLine());
  14.             double points = double.Parse(Console.ReadLine());
  15.             string season = Console.ReadLine().ToLower();
  16.             string location = Console.ReadLine();
  17.             var price = 0.0;
  18.             var razhodi = 0.0;
  19.             var TotalPrice = 0.0;
  20.             if (season== "summer")
  21.             {
  22.                 if (location== "Bulgaria")
  23.                 {
  24.                     price = points * numberDancer;
  25.                     razhodi = price * 0.05;
  26.                     TotalPrice = price - razhodi;
  27.                 }
  28.  
  29.                 else if (location== "Abroad")
  30.                 {
  31.                     price = numberDancer * points;
  32.                     razhodi = price * 0.10;
  33.                     var bonus = price * 0.50;
  34.                     TotalPrice = (bonus + price) - razhodi;
  35.                 }
  36.             }
  37.             else if (season=="winter")
  38.             {
  39.                 if (location == "Bulgaria")
  40.                 {
  41.                     price = points * numberDancer;
  42.                     razhodi = price * 0.08;
  43.                     TotalPrice = price - razhodi;
  44.                 }
  45.  
  46.                 else if (location == "Abroad")
  47.                 {
  48.                     price = numberDancer * points;
  49.                     razhodi = price * 0.15;
  50.                     var bonus = price * 0.50;
  51.                     TotalPrice = (bonus+ price) - razhodi;
  52.                 }
  53.             }
  54.             var Charity = TotalPrice-(TotalPrice * 0.75);
  55.             var MoneyForCharity = TotalPrice-Charity;
  56.             var MoneyPerDancer = (TotalPrice - MoneyForCharity) / numberDancer;
  57.             Console.WriteLine($"Charity - {MoneyForCharity:F2}");
  58.             Console.WriteLine($"Money per dancer - {MoneyPerDancer:F2}");
  59.         }
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment