Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import.java.util.Scanner;
- public class Main {
- public static void main (Sting [ ] args) {
- Scanner scanner = new Scanner (System.in);
- int tablesNumber = Integer.parseInt (scanner.nextLine());
- double tablesLength = Double.parseDouble(scanner.nextLine());
- double tablesWidth = Double.parseDouble(scanner.nextLine());
- double clothesArea = tablesNumber * (tablesLenght + 2 * 0.30) * (tablesWidth + 2 * 0.30);
- double squareArea = tablesNumber * (tablesLength / 2) * (tablesLength / 2);
- double priceUSD = clothesArea * 7 + squareArea * 9;
- double priceBGN = priceUSD * 1.85;
- System.out.printf ("%.2f USD %n", priceUSD);
- System.out.printf ("%.2f BGN", priceBGN);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement