Advertisement
Guest User

Untitled

a guest
Feb 29th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. package Actual_Mid_Exam;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Task3 {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8. int firstEmployerPpl = Integer.parseInt(scanner.nextLine());
  9. int secondEmployerPpl = Integer.parseInt(scanner.nextLine());
  10. int thirdEmployerPpl = Integer.parseInt(scanner.nextLine());
  11. int totalPatients = Integer.parseInt(scanner.nextLine());
  12. int totalEmployersForHour = firstEmployerPpl + secondEmployerPpl + thirdEmployerPpl;
  13. int hrs = 0;
  14. while (totalPatients > 0) {
  15. hrs++;
  16. if (hrs % 4 != 0) {
  17. totalPatients -= totalEmployersForHour;
  18.  
  19. }
  20. }
  21. System.out.println("Time needed: " + hrs + "h.");
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement