Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class TailoringWorkshop {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int tables = Integer.parseInt(scan.nextLine());
- double length = Double.parseDouble(scan.nextLine());
- double width = Double.parseDouble(scan.nextLine());
- double areaOneCover = (length + 2 * 0.30) * (width + 2 * 0.30);
- double areaOneSquares = (length / 2) * (length / 2);
- double areaCover = tables * areaOneCover;
- double areaSquares = tables * areaOneSquares;
- double priceCovers = areaOneCover * 7;
- double priceSquares = areaOneSquares * 9;
- double totalPriceInDollars = priceCovers + priceSquares;
- double totalPriceInBGN = totalPriceInDollars * 1.85;
- System.out.printf("%.2f USD%n", totalPriceInDollars);
- System.out.printf("%.2f BGN", totalPriceInBGN);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement