Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package W01FirstStepsInCoding.Exercises;
- import java.util.Scanner;
- public class P06Repainting {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- //Прочитаме входните данни
- int neededNylon = Integer.parseInt(scanner.nextLine());
- int neededPaint = Integer.parseInt(scanner.nextLine());
- int neededThinner = Integer.parseInt(scanner.nextLine());
- int neededHours = Integer.parseInt(scanner.nextLine());
- //Пресмятаме необходимотo количество найлон, боя и разредител,
- // като добавяме 10% за боя и разредител и 2кв.м. найлон
- double nylonPrice = (neededNylon + 2) * 1.50;
- double paintPrice = (neededPaint + neededPaint * 0.10) * 14.50;
- double thinnerPrice = neededThinner * 5.00;
- //Пресмятам общата сума за материалите
- double totalSumForMaterials = nylonPrice + paintPrice + thinnerPrice + 0.40;
- //Пресмятаме сумата за труда
- double buildersPrice = (totalSumForMaterials * 0.30) * neededHours;
- //Пресмятаме общата сума => сумата за материали + сумата за труд на майсторите
- double totalSum = totalSumForMaterials + buildersPrice;
- System.out.println(totalSum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement