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 scanner = new Scanner(System.in);
- int tables = Integer.parseInt(scanner.nextLine());
- double tableLenght = Double.parseDouble(scanner.nextLine());
- double tablewidth = Double.parseDouble(scanner.nextLine());
- double USD = 1.85;
- double pokrivki = tables *(tableLenght + 2 * 0.30) * (tablewidth + 2 * 0.30);
- double kareta = tables * (tableLenght / 2) * (tableLenght / 2);
- double priceBGN = pokrivki + kareta;
- double priceUSD = pokrivki * USD + kareta * USD;
- String resultUSD = priceUSD + " " + "USD";
- String resultBGN = priceBGN + " " + "BGN";
- System.out.printf("%.2f", resultUSD);
- System.out.printf("%.2f", resultBGN);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement