Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Salary {
- public static void main(String[] args) {
- Scanner scan=new Scanner(System.in);
- int hours= Integer.parseInt(scan.nextLine());
- int days= Integer.parseInt(scan.nextLine());
- int employees= Integer.parseInt(scan.nextLine());
- double daysForWork = days-(0.1*days);
- double workedHours = daysForWork*8;
- double overtime= employees*2*days;
- double totalHours= Math.floor(workedHours+overtime);
- if(totalHours<hours){
- System.out.printf("Not enough time!%.0f hours needed.",hours-totalHours);
- }else{
- System.out.printf("Yes!%.0f hours left.",totalHours-hours);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement