Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package L01_FirstStepsInCoding_EXC;
- import java.util.Scanner;
- public class P06_Repainting {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- //1. Прочитаме входните данни
- //2. Пресмятаме колко трябва да се плати за всеки материал по отделно.
- //3. Общата сума за материали-> цената за боя, цената за найлон, цената за разредите (торбички)
- //4. Пресментем цената за труд на майсторите
- //5. Крайната сума
- //6. Принтираме
- int neededNylon = Integer.parseInt(scanner.nextLine());
- int neededPaint = Integer.parseInt(scanner.nextLine());
- int neededThinner = Integer.parseInt(scanner.nextLine());
- int neededHours = Integer.parseInt(scanner.nextLine());
- //• Предпазен найлон - 1.50 лв. за кв. метър
- //• Боя - 14.50 лв. за литър
- //• Разредител за боя - 5.00 лв. за литър
- double nylonPrice = (neededNylon + 2) * 1.50;
- double paintPrice = (neededPaint + neededPaint * 0.1) * 14.50; //(neededPaint + neededPaint * 10/100.0) * 14.50
- double thinnerPrice = neededThinner * 5;
- double totalSumMaterials = nylonPrice + paintPrice + thinnerPrice + 0.40;
- double buildersPrice = (totalSumMaterials * 0.3) * neededHours;
- double totalSum = totalSumMaterials + buildersPrice;
- System.out.println(totalSum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment