Advertisement
Valantina

Repainting/Ex/Java

Jul 10th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.87 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class P01_Repainting {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.  
  7.         int nylonSize = Integer.parseInt(scan.nextLine());
  8.         int paintLiters = Integer.parseInt(scan.nextLine());
  9.         int diluentLiters = Integer.parseInt(scan.nextLine());
  10.         int days = Integer.parseInt(scan.nextLine());
  11.  
  12.         double nylonPrice = 1.50;
  13.         double paintPrice = 14.50;
  14.         double diluentPrice = 5;
  15.         double bagsPrice = 0.40;
  16.  
  17.         double expenses = (nylonSize + 2) * nylonPrice + paintLiters * 1.10 * paintPrice + diluentLiters * diluentPrice + bagsPrice;
  18.         double workersExpenses = days * (expenses * 0.30);
  19.         double totalExpenses = workersExpenses + expenses;
  20.  
  21.         System.out.println(String.format("Total expenses: %.2f lv.", totalExpenses));
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement