svetoslav_0

WorkHours

Jan 18th, 2018
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 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 ConsoleApplication4
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var needHours = double.Parse(Console.ReadLine());
  14.             var players = double.Parse(Console.ReadLine());
  15.             var workedDays = double.Parse(Console.ReadLine());
  16.  
  17.  
  18.             var work = (players * workedDays) * 8;
  19.             var penalties = work - needHours;
  20.  
  21.             if (work > needHours)
  22.             {
  23.                 Console.WriteLine($"{penalties:f0} hours left");
  24.             }
  25.             else if (work < needHours)
  26.             {
  27.                 Console.WriteLine($"{Math.Abs(penalties):f0} overtime");
  28.                 Console.WriteLine($"Penalties: {Math.Abs(penalties) * workedDays:f0}");
  29.  
  30.  
  31.  
  32.             }
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment