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);
- int neededProcessors = Integer.parseInt(scanner.nextLine()),
- workers = Integer.parseInt(scanner.nextLine()),
- days = Integer.parseInt(scanner.nextLine()),
- workingHoursPerDay = 8, processorBuildHours = 3;
- double processorPrice = 110.10,
- diff = (neededProcessors - Math.floor(1.0 * workers * days * workingHoursPerDay / processorBuildHours)) * processorPrice;
- if (diff > 0) {
- System.out.printf("Losses: -> %.2f BGN\n", diff);
- } else {
- System.out.printf("Profit: -> %.2f BGN\n", Math.abs(diff));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement