myrdok123

P06_Repainting

Jan 8th, 2023
846
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.48 KB | None | 1 0
  1. package L01_Exercises;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class P06_Repainting {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner scanner = new Scanner(System.in);
  9.  
  10.         /*Предпазен найлон - 1.50 лв. за кв. метър
  11.         Боя - 14.50 лв. за литър
  12.         Разредител за боя - 5.00 лв. за литър*/
  13.  
  14.         //1. Четем от конзолата
  15.         //2. Пресмятаме колко струват всички материали
  16.         //3. Пресмятаме колко струва на час работата на майсторите
  17.         //4. Изчисляваме цялата сума за ремонта
  18.         //5. Принтираме
  19.  
  20.         int neededNylon = Integer.parseInt(scanner.nextLine());
  21.         int neededPaint = Integer.parseInt(scanner.nextLine());
  22.         int thinner = Integer.parseInt(scanner.nextLine());
  23.         int hours = Integer.parseInt(scanner.nextLine());
  24.  
  25.         double nylonPrice = (neededNylon + 2) * 1.50;
  26.         double paintPrice = (neededPaint + (neededPaint * 0.1)) * 14.50;// neededPaint * 1.1
  27.         double thinnerPrice = thinner * 5.00;
  28.  
  29.         double materialsSum = nylonPrice + paintPrice + thinnerPrice + 0.40;
  30.  
  31.         double priceForBuilders = hours * (materialsSum * 0.30); // materialsSum - (materialsSum * 0.7)
  32.  
  33.         double finalSum = priceForBuilders + materialsSum;
  34.  
  35.         System.out.println(finalSum);
  36.  
  37.  
  38.     }
  39.  
  40. }
  41.  
Advertisement
Add Comment
Please, Sign In to add comment