Advertisement
GabrielHr00

06. Repainting

Mar 10th, 2024
619
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.86 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 plasticCount = Integer.parseInt(scanner.nextLine());
  7.         int paintLiters = Integer.parseInt(scanner.nextLine());
  8.         int thinnerLiters = Integer.parseInt(scanner.nextLine());
  9.         int hoursTotalWorkers = Integer.parseInt(scanner.nextLine());
  10.  
  11.         double plasticSum = (plasticCount + 2) * 1.50;
  12.         double paintSum = (paintLiters + (paintLiters * 0.10)) * 14.50;
  13.         double thinnerSum = thinnerLiters * 5.0;
  14.         double totalSum = plasticSum + paintSum + thinnerSum + 0.40;
  15.  
  16.         double priceWorkersForOneHour = totalSum * 0.30;
  17.         double priceWorkersAll = priceWorkersForOneHour * hoursTotalWorkers;
  18.         System.out.println(totalSum + priceWorkersAll);
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement