Advertisement
GabrielHr00

06. Repainting

May 14th, 2023
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.85 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Repainting {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int plasticMeters = Integer.parseInt(scanner.nextLine());
  7.         int paintLiters = Integer.parseInt(scanner.nextLine());
  8.         int thinnerLiters = Integer.parseInt(scanner.nextLine());
  9.         int workersHours = Integer.parseInt(scanner.nextLine());
  10.  
  11.         double plasticSum = (plasticMeters + 2) * 1.50;
  12.         double paintSum = (paintLiters + (paintLiters * 0.10)) * 14.50;
  13.         double thinnerSum = thinnerLiters * 5.00;
  14.         double totalSum = plasticSum + paintSum + thinnerSum + 0.40;
  15.  
  16.         double priceForWorkersPerHour = totalSum * 0.30;
  17.         double workersTotalPrice = priceForWorkersPerHour * workersHours;
  18.  
  19.         System.out.println(totalSum + workersTotalPrice);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement