Advertisement
AleksandarGG

Trainers Salary

Aug 25th, 2017
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.37 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 _04___Trainers_Salary
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double lections = double.Parse(Console.ReadLine());
  14.             double budget = double.Parse(Console.ReadLine());
  15.            
  16.  
  17.             string roli = null;
  18.             string trofon = null;
  19.             string sino = null;
  20.             string jelev = null;
  21.             string royal = null;
  22.             string others = null;
  23.             double counter = 0.0;
  24.             double counterJelev = 0.0;
  25.             double counterRoli = 0.0;
  26.             double counterTrofon = 0.0;
  27.             double counterSino = 0.0;
  28.             double counterRoYal = 0.0;
  29.  
  30.             for (int i = 1; i <= lections ; i++)
  31.             {
  32.                 string lector = Console.ReadLine();
  33.  
  34.                 if (lector == "Roli")
  35.                 {
  36.                     counterRoli++;
  37.                 }
  38.                 else if (lector == "Trofon")
  39.                 {
  40.                     counterTrofon++;  
  41.                 }
  42.                 else if (lector == "Sino")
  43.                 {
  44.                     counterSino++;
  45.                 }
  46.                 else if (lector == "Jelev")
  47.                 {
  48.                     counterJelev++;
  49.                 }
  50.                 else if (lector == "RoYaL")
  51.                 {
  52.                     counterRoYal++;
  53.                 }
  54.                 else
  55.                 {
  56.                     counter++;
  57.                 }
  58.                
  59.             }
  60.             roli += (budget / lections) * counterRoli;
  61.             trofon += (budget / lections) * counterTrofon;
  62.             sino += (budget / lections) * counterSino;
  63.             jelev += (budget / lections) * counterJelev;
  64.             royal += (budget / lections) * counterRoYal;
  65.             others += (budget / lections) * counter;
  66.  
  67.             Console.WriteLine($"Jelev salary: {jelev:f2} lv");
  68.             Console.WriteLine($"RoYaL salary: {royal:f2} lv");
  69.             Console.WriteLine($"Roli salary: {roli:f2} lv");
  70.             Console.WriteLine($"Trofon salary: {trofon:f2} lv");
  71.             Console.WriteLine($"Sino salary: {sino:f2} lv");
  72.             Console.WriteLine($"Others salary: {others:f2} lv");
  73.            
  74.         }
  75.     }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement