Advertisement
MilaDimitrovaa

Firma

Nov 3rd, 2019
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. package homework22222;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class firma {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner scan= new Scanner(System.in);
  9.         int hours = scan.nextInt();
  10.         int days = scan.nextInt();
  11.         int workers = scan.nextInt();
  12.        
  13.         double workDays = days * 0.9;
  14.         double extraHours = (workers * 2) * days;
  15.         double workHours = (workDays * 8 * workers) + extraHours;
  16.         double totalHours = Math.floor(workHours + extraHours);
  17.        
  18.         if(totalHours > hours) {
  19.             System.out.printf("Yes! %.0f hours left." , Math.floor(workHours - hours));
  20.         }else {
  21.             System.out.printf("Not enough time! %.0f hours needed." , Math.floor(hours - workHours));
  22.            
  23.         }
  24.        
  25.  
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement