Advertisement
Guest User

Untitled

a guest
Apr 16th, 2023
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | None | 0 0
  1. using System;
  2.  
  3. namespace MyApp
  4. {
  5.     internal class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var projecthours = int.Parse(Console.ReadLine());
  10.             var availabledays = int.Parse(Console.ReadLine());
  11.             var overtimeWorkers = int.Parse(Console.ReadLine());
  12.  
  13.             double workDays = availabledays * 0.9;
  14.             double overtimeHours = overtimeWorkers * workDays * 2;
  15.             double workHours = overtimeHours + workDays * 8 * overtimeWorkers;
  16.             double hoursDiff = Math.Floor(Math.Abs(projecthours - workHours));
  17.            
  18.             if (workHours >= projecthours)
  19.             {
  20.                 Console.WriteLine("Yes!{0} hours left.", hoursDiff);
  21.             }
  22.             else
  23.             {
  24.                 Console.WriteLine("Not enough time!{0} hours needed.",hoursDiff);
  25.             }
  26.  
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement