Advertisement
veronikaaa86

06. Repainting

Oct 31st, 2021
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. package firstSteps;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class P06Repainting {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8.  
  9. int nylonQuantity = Integer.parseInt(scanner.nextLine());
  10. int paintQuantity = Integer.parseInt(scanner.nextLine());
  11. int razrQuantity = Integer.parseInt(scanner.nextLine());
  12. int countHours = Integer.parseInt(scanner.nextLine());
  13.  
  14. double priceAllNylon = (nylonQuantity + 2) * 1.50;
  15. double priceAllPaint = (paintQuantity * 1.10) * 14.50;
  16. double priceAllRazr = razrQuantity * 5.00;
  17.  
  18. double allMaterialsPrice = priceAllNylon + priceAllPaint + priceAllRazr + 0.40;
  19. double workersSum = (allMaterialsPrice * 0.30) * countHours;
  20.  
  21. double totalSum = allMaterialsPrice + workersSum;
  22.  
  23. System.out.println(totalSum);
  24. }
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement