Advertisement
marking2112

Untitled

Jun 4th, 2018
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1.  
  2. import java.util.Scanner;
  3.  
  4. public class Workshoptr {
  5. public static void main(String[] args) {
  6. Scanner scanner = new Scanner(System.in);
  7.  
  8. int tables = Integer.parseInt(scanner.nextLine());
  9. Double tablesLenght = Double.parseDouble(scanner.nextLine());
  10. Double tablesWidth = Double.parseDouble(scanner.nextLine());
  11.  
  12. Double area1 = tables * (tablesLenght + 2 * 0.3) * (tablesWidth + 2 * 0.3);
  13. Double area2 = tables * (tablesLenght / 2) * (tablesLenght / 2);
  14.  
  15. Double USD = (area1 * 7) + (area2 * 9);
  16. Double BGN = USD * 1.85;
  17.  
  18. System.out.printf("%.2f USD%n", USD);
  19. System.out.printf("%.2f BGN", BGN);
  20.  
  21.  
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement