yovkovbpfps

Simple Operation and Calculation Tailoring Workshop

Apr 19th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class wa {
  3. public static void main(String[] args) {
  4. Scanner scanner = new Scanner(System.in);
  5. int tables = Integer.parseInt(scanner.nextLine());
  6. double lenght = Double.parseDouble(scanner.nextLine());
  7. double width = Double.parseDouble(scanner.nextLine());
  8.  
  9. double areaOneCover = (lenght + 2 * 0.30) * (width + 2 * 0.30);
  10. double areaOneSquare = (lenght / 2) * (lenght / 2);
  11.  
  12. double areaCovers = tables * areaOneCover;
  13. double areaSquare = tables * areaOneSquare;
  14.  
  15. double priceCovers = areaCovers * 7;
  16. double priceSquare = areaSquare * 9;
  17. double totalPriceInDollars = priceCovers + priceSquare;
  18.  
  19. double totalPriceInBGN = totalPriceInDollars * 1.85;
  20.  
  21.  
  22. System.out.printf("%.2f USD%n", totalPriceInDollars);
  23. System.out.printf("%.2f BGN", totalPriceInBGN);
  24.  
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment