Advertisement
ventsislav83

Salary

Jun 22nd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1. public class Salary {
  2.  
  3.     public static void main(String[] args) {
  4.         Scanner scan=new Scanner(System.in);
  5.         int hours= Integer.parseInt(scan.nextLine());
  6.         int days= Integer.parseInt(scan.nextLine());
  7.          int employees= Integer.parseInt(scan.nextLine());
  8.          double daysForWork = days-(0.1*days);
  9.          double workedHours = daysForWork*8;
  10.          double overtime= employees*2*days;
  11.          double totalHours= Math.floor(workedHours+overtime);
  12.          if(totalHours<hours){
  13.              System.out.printf("Not enough time!%.0f hours needed.",hours-totalHours);
  14.          }else{
  15.              System.out.printf("Yes!%.0f hours left.",totalHours-hours);
  16.          }
  17.     }
  18.    
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement