Advertisement
MladenKarachanov

Untitled

May 11th, 2022
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. package firstStepsInCoding;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Repainting {
  6. public static void main(String[] args) {
  7. Scanner scanner= new Scanner(System.in);
  8. int nylon=Integer.parseInt(scanner.nextLine());
  9. int paint=Integer.parseInt(scanner.nextLine());
  10. int thinner=Integer.parseInt(scanner.nextLine());
  11. int hours=Integer.parseInt(scanner.nextLine());
  12. double priceNylon=1.50;
  13. double pricePaint=14.50;
  14. double priceThinner=5.00;
  15. double bags=0.40;
  16.  
  17. double totalNylon=(nylon+2)*priceNylon;
  18. double totalPaint=(paint*0.1+paint)*pricePaint;
  19. double totalThinner=thinner*priceThinner;
  20. double result=totalPaint+totalNylon+totalThinner+bags;
  21. double costs=result*0.3*hours;
  22. double finish=costs+result;
  23.  
  24. System.out.println(finish);
  25.  
  26. }
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement