Advertisement
Svetla

Firm/Exam 28.8.2016

Jan 19th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.84 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class FirmEx280816 {
  4.     public static void main(String[] args) {
  5.         Scanner scanner=new Scanner(System.in);
  6.  
  7.         int projectTime=Integer.parseInt(scanner.nextLine());
  8.         int daysF=Integer.parseInt(scanner.nextLine());
  9.         int peopleOverTime=Integer.parseInt(scanner.nextLine());
  10.  
  11.         int overTime=peopleOverTime*(2*daysF);
  12.         double trainingDay=daysF-(daysF*0.1);
  13.         double workHours=trainingDay*8;
  14.         double allHours=Math.floor(workHours + overTime);
  15.  
  16.         if(projectTime<allHours){
  17.             int result =(int)(allHours-projectTime);
  18.             System.out.printf("Yes!%d hours left.", result);
  19.         }else {
  20.             int result2=(int)(projectTime-allHours);
  21.             System.out.printf("Not enough time!%d hours needed.", result2);
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement