Advertisement
Guest User

Untitled

a guest
Jul 30th, 2020
824
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Reception {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int employeesOne = Integer.parseInt(scanner.nextLine());
  8.         int employeesTwo = Integer.parseInt(scanner.nextLine());
  9.         int employeesThree = Integer.parseInt(scanner.nextLine());
  10.  
  11.         int studentCount = Integer.parseInt(scanner.nextLine());
  12.  
  13.         double neededHours = 0;
  14.         double answerPerHour = employeesOne + employeesTwo + employeesThree;
  15.  
  16.         while (studentCount > 0){
  17.             studentCount -= answerPerHour;
  18.             neededHours++;
  19.  
  20.             if (neededHours % 4 == 0) ;
  21.             neededHours++;
  22.  
  23.             System.out.printf("Time needed: %f", answerPerHour);
  24.  
  25.         }
  26.     }
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement