Lyubohd

01. Repainting

Oct 24th, 2020
442
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

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×