nvnnaidenov

Firm - Chapter 3.1

Feb 10th, 2022
1,113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1. //Task 005, Chapter 3.1
  2. using System;
  3.  
  4. public class Firm
  5. {
  6.     static void Main()
  7.     {
  8.         int hours = int.Parse(Console.ReadLine());
  9.         int days = int.Parse(Console.ReadLine());
  10.         int workers = int.Parse(Console.ReadLine());
  11.  
  12.         double workDays = days * 0.90;
  13.         double overtime = workers * 2 * workDays;
  14.         double workHours = Math.Floor(workDays * 8 + overtime);
  15.  
  16.         if(hours <=  workHours)
  17.         {
  18.             Console.WriteLine($"Not enough time!{workHours - hours} hours needed.");        
  19.         }
  20.         else
  21.         {
  22.             Console.WriteLine($"Yes!{hours - workHours} hours left.");
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment