Advertisement
Guest User

PetarPetrov

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