Advertisement
SMWorks

bb

Jul 28th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.67 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. namespace Exam2
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             var dancersCount = int.Parse(Console.ReadLine());
  11.             var points = double.Parse(Console.ReadLine());
  12.             var season = Console.ReadLine();
  13.             var place = Console.ReadLine();
  14.             Boolean flag = true;
  15.             double resolution = 0.0;
  16.  
  17.            
  18.             switch (place)
  19.             {
  20.                 case "Bulgaria":
  21.                     resolution = dancersCount * points;
  22.                     break;
  23.                 case "Abroad":
  24.                     resolution = dancersCount * points;
  25.                     resolution = resolution + (resolution / 2);
  26.                     flag = false;
  27.                     break;
  28.                 default:
  29.                     Console.WriteLine("Values can be only 'Bulgaria' and 'Abroad'.");
  30.                     return;
  31.             }
  32.  
  33.  
  34.             double totalSum = resolution;
  35.  
  36.             if (season == "summer" && flag)
  37.             {
  38.                 totalSum -= totalSum * 0.05;
  39.             } else if (season == "summer" && !flag)
  40.             {
  41.                 totalSum -= totalSum * 0.10;
  42.             } else if (season == "winter" && flag)
  43.             {
  44.                 totalSum -= totalSum * 0.08;
  45.             } else
  46.             {
  47.                 totalSum -= totalSum * 0.15;
  48.             }
  49.  
  50.             double forCharity = totalSum * 0.75;
  51.             totalSum -= forCharity;
  52.  
  53.             totalSum /= dancersCount;
  54.  
  55.             Console.WriteLine($"Charity - {forCharity:F2}\nMoney per dancer - {totalSum:F2}");
  56.  
  57.  
  58.  
  59.            
  60.        
  61.         }
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement