Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. import.java.util.Scanner;
  2.  
  3. public class Main {
  4. public static void main (Sting [ ] args) {
  5. Scanner scanner = new Scanner (System.in);
  6.  
  7. int tablesNumber = Integer.parseInt (scanner.nextLine());
  8. double tablesLength = Double.parseDouble(scanner.nextLine());
  9. double tablesWidth = Double.parseDouble(scanner.nextLine());
  10.  
  11. double clothesArea = tablesNumber * (tablesLenght + 2 * 0.30) * (tablesWidth + 2 * 0.30);
  12.  
  13. double squareArea = tablesNumber * (tablesLength / 2) * (tablesLength / 2);
  14.  
  15. double priceUSD = clothesArea * 7 + squareArea * 9;
  16.  
  17. double priceBGN = priceUSD * 1.85;
  18.  
  19. System.out.printf ("%.2f USD %n", priceUSD);
  20. System.out.printf ("%.2f BGN", priceBGN);
  21.  
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement