Advertisement
dimipan80

Exam 3. Work Hours

Jun 7th, 2014
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1. namespace _1.WorkHours
  2. {
  3.     using System;
  4.  
  5.     public class WorkHours
  6.     {
  7.         public static void Main(string[] args)
  8.         {
  9.             checked
  10.             {
  11.                 int givenWorkHours = int.Parse(Console.ReadLine());
  12.                 int availableDays = int.Parse(Console.ReadLine());
  13.                 int productivity = int.Parse(Console.ReadLine());
  14.  
  15.                 int workHours = (int)(availableDays * 0.9 * 12 * (productivity / 100d));
  16.  
  17.                 int difference = workHours - givenWorkHours;
  18.                 if (difference >= 0)
  19.                 {
  20.                     Console.WriteLine("Yes");
  21.                 }
  22.                 else
  23.                 {
  24.                     Console.WriteLine("No");
  25.                 }
  26.  
  27.                 Console.WriteLine(difference);
  28.             }
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement