Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package homework22222;
- import java.util.Scanner;
- public class firma {
- public static void main(String[] args) {
- Scanner scan= new Scanner(System.in);
- int hours = scan.nextInt();
- int days = scan.nextInt();
- int workers = scan.nextInt();
- double workDays = days * 0.9;
- double extraHours = (workers * 2) * days;
- double workHours = (workDays * 8 * workers) + extraHours;
- double totalHours = Math.floor(workHours + extraHours);
- if(totalHours > hours) {
- System.out.printf("Yes! %.0f hours left." , Math.floor(workHours - hours));
- }else {
- System.out.printf("Not enough time! %.0f hours needed." , Math.floor(hours - workHours));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement