Advertisement
Guest User

Exam Problem 01 [Work Hours]

a guest
Jun 2nd, 2015
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. using System;
  2.  
  3. class WorkHours
  4. {
  5.     static void Main()
  6.     {
  7.         // inputs
  8.         int requiredHours = int.Parse(Console.ReadLine());
  9.         double daysAvailable = double.Parse(Console.ReadLine());
  10.         double productivity = double.Parse(Console.ReadLine());
  11.  
  12.         double workingHours = (daysAvailable - (daysAvailable * 0.1)) * 12 * productivity / 100;
  13.         if (workingHours < requiredHours)
  14.         {
  15.             Console.WriteLine("No");
  16.             Console.WriteLine((int)workingHours - requiredHours);
  17.         }
  18.         else
  19.         {
  20.             Console.WriteLine("Yes");
  21.             Console.WriteLine((int)workingHours - requiredHours);
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement