Advertisement
fr3s7ed

Untitled

Feb 13th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class TailoringWorkshop {
  4. public static void main(String[] args) {
  5.  
  6. Scanner scanner = new Scanner(System.in);
  7.  
  8. int tables = Integer.parseInt(scanner.nextLine());
  9. double tableLenght = Double.parseDouble(scanner.nextLine());
  10. double tablewidth = Double.parseDouble(scanner.nextLine());
  11.  
  12. double USD = 1.85;
  13.  
  14. double pokrivki = tables *(tableLenght + 2 * 0.30) * (tablewidth + 2 * 0.30);
  15. double kareta = tables * (tableLenght / 2) * (tableLenght / 2);
  16.  
  17. double priceBGN = pokrivki + kareta;
  18. double priceUSD = pokrivki * USD + kareta * USD;
  19.  
  20. String resultUSD = priceUSD + " " + "USD";
  21. String resultBGN = priceBGN + " " + "BGN";
  22.  
  23. System.out.printf("%.2f", resultUSD);
  24. System.out.printf("%.2f", resultBGN);
  25.  
  26.  
  27.  
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement