Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Firm {
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- int projectHours = Integer.parseInt(console.nextLine());
- int daysForProject = Integer.parseInt(console.nextLine());
- int workers = Integer.parseInt(console.nextLine());
- double workingDays = (daysForProject - (daysForProject*0.10));
- double workInProcesHours = workingDays * 8;
- double overWorkingHours = workers * ( 2 * daysForProject);
- double totalWorkingHours = Math.floor(overWorkingHours + workInProcesHours);
- double timeIsEnought = 0;
- if(totalWorkingHours > projectHours){
- timeIsEnought = Math.floor(projectHours - totalWorkingHours);
- timeIsEnought = Math.abs(timeIsEnought);
- System.out.print("Yes!" + (int)timeIsEnought + " hours left.");
- }else{
- timeIsEnought = Math.floor(totalWorkingHours - projectHours);
- timeIsEnought = Math.abs(timeIsEnought);
- System.out.print("Not enough time!" + (int)timeIsEnought + " hours needed.");
- }
- }
- }
Add Comment
Please, Sign In to add comment