Lyubohd

01. Repainting

Oct 24th, 2020
404
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.  
  7.         int nylonNeeded = Integer.parseInt(scan.nextLine());
  8.         int paintNeeded = Integer.parseInt(scan.nextLine());
  9.         int dissolveNeeded = Integer.parseInt(scan.nextLine());
  10.         int workersWorkingHours = Integer.parseInt(scan.nextLine());
  11.  
  12.         double nylonPrice = (nylonNeeded + 2) * 1.50;
  13.         double paintPrice = (paintNeeded * 1.10) * 14.50;
  14.         int dissolvePrice = dissolveNeeded * 5;
  15.  
  16.         double totalPrice = nylonPrice + paintPrice + dissolvePrice + 0.40;
  17.         double workersSalaryPerHour = totalPrice * 0.30;
  18.         double workersTotalSalary = workersSalaryPerHour * workersWorkingHours;
  19.  
  20.         double finalPrice = totalPrice + workersTotalSalary;
  21.  
  22.         System.out.printf("Total expenses: %.2f lv.", finalPrice);
  23.     }
  24. }
RAW Paste Data