Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class wa {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int tables = Integer.parseInt(scanner.nextLine());
- double lenght = Double.parseDouble(scanner.nextLine());
- double width = Double.parseDouble(scanner.nextLine());
- double areaOneCover = (lenght + 2 * 0.30) * (width + 2 * 0.30);
- double areaOneSquare = (lenght / 2) * (lenght / 2);
- double areaCovers = tables * areaOneCover;
- double areaSquare = tables * areaOneSquare;
- double priceCovers = areaCovers * 7;
- double priceSquare = areaSquare * 9;
- double totalPriceInDollars = priceCovers + priceSquare;
- 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