Advertisement
Guest User

Untitled

a guest
May 25th, 2018
911
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 examtask2 {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.         int countProcessors = Integer.parseInt(scan.nextLine());
  7.         int countEmployee = Integer.parseInt(scan.nextLine());
  8.         int countDays = Integer.parseInt(scan.nextLine());
  9.  
  10.         double workhours = countEmployee * countDays * 8;
  11.         double timeprocesors = Math.floor(workhours / 3);
  12.  
  13.         if (timeprocesors < countProcessors) {
  14.             double proc = countProcessors - timeprocesors;
  15.  
  16.             System.out.printf("Losses: -> %.2f BGN", proc * 110.10);
  17.         } else {
  18.             double procs = timeprocesors - countProcessors;
  19.  
  20.             System.out.printf("Profit: -> %.2f BGN", procs * 110.10);
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement