Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int nylonNeeded = Integer.parseInt(scan.nextLine());
- int paintNeeded = Integer.parseInt(scan.nextLine());
- int dissolveNeeded = Integer.parseInt(scan.nextLine());
- int workersWorkingHours = Integer.parseInt(scan.nextLine());
- double nylonPrice = (nylonNeeded + 2) * 1.50;
- double paintPrice = (paintNeeded * 1.10) * 14.50;
- int dissolvePrice = dissolveNeeded * 5;
- double totalPrice = nylonPrice + paintPrice + dissolvePrice + 0.40;
- double workersSalaryPerHour = totalPrice * 0.30;
- double workersTotalSalary = workersSalaryPerHour * workersWorkingHours;
- double finalPrice = totalPrice + workersTotalSalary;
- System.out.printf("Total expenses: %.2f lv.", finalPrice);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement