Advertisement
GabrielHr00

06. Repainting

Jan 5th, 2025
200
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 plasticCount = Integer.parseInt(scanner.nextLine());
  7.         int paintLiters = Integer.parseInt(scanner.nextLine());
  8.         int thinnerLiters = Integer.parseInt(scanner.nextLine());
  9.         int hoursWorkers = Integer.parseInt(scanner.nextLine());
  10.  
  11.         double plasticPrice = 1.50 * (plasticCount + 2);
  12.         double paintPrice = 14.50 * (paintLiters + (paintLiters * 0.10));
  13.         double thinnerPrice = 5.00 * thinnerLiters;
  14.  
  15.         double sumAll = plasticPrice + paintPrice + thinnerPrice + 0.40;
  16.  
  17.         double priceWorkersForHour = 0.30 * sumAll;
  18.         double sumAllWorkers = priceWorkersForHour * hoursWorkers;
  19.  
  20.         System.out.println(sumAll + sumAllWorkers);
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement