Advertisement
silvana1303

firm

Mar 24th, 2020
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 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. namespace silvanadoc
  7. {
  8.     class silvanadoc
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             int hoursNeeded = int.Parse(Console.ReadLine());
  13.             int daysAvailable = int.Parse(Console.ReadLine());
  14.             int workersOvertime = int.Parse(Console.ReadLine());
  15.  
  16.             var hoursWorking = (daysAvailable * 0.90) * 8;
  17.             var overtimeHours = workersOvertime * (2 * daysAvailable);
  18.             var allHours = Math.Floor(hoursWorking) + overtimeHours;
  19.             var hoursLeft = Math.Floor(allHours) - hoursNeeded;
  20.             var hoursMore = hoursNeeded - allHours;
  21.  
  22.             if (allHours >= hoursNeeded)
  23.             {
  24.                 Console.WriteLine($"Yes!{Math.Floor(hoursLeft)} hours left.");
  25.             }
  26.             else
  27.             {
  28.                 Console.WriteLine($"Not enough time!{Math.Floor(hoursMore)} hours needed.");
  29.             }
  30.  
  31.  
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement