Advertisement
Aliendreamer

workinghours

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