Advertisement
grach

2017_18_March_Work Hours

Jul 20th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 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 Work_hours
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int workHours = int.Parse(Console.ReadLine());
  14.             int workers = int.Parse(Console.ReadLine());
  15.             int workDays = int.Parse(Console.ReadLine());
  16.  
  17.             var workTime = workers * workDays * 8;
  18.  
  19.             var result = 0.0;
  20.  
  21.             if (workTime > workHours)
  22.             {
  23.                 result = (workTime - workHours);
  24.                 Console.WriteLine("{0} hours left", result);
  25.             }
  26.  
  27.             else if (workTime < workHours)
  28.             {
  29.                 result = (workHours - workTime);
  30.                 Console.WriteLine("{0} overtime", result);
  31.                 Console.WriteLine($"Penalties: {result * workDays}");
  32.             }
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement