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