Advertisement
desislava_topuzakova

Шивашки цех

Jan 19th, 2018
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class TaylorShop {
  4.     public static void main(String[] agrs) {
  5.         Scanner scan = new Scanner(System.in);
  6.  
  7.         int tables = Integer.parseInt(scan.nextLine());
  8.         double lenghtM = Double.parseDouble(scan.nextLine());
  9.         double widthM = Double.parseDouble(scan.nextLine());
  10.  
  11.         double areaCovers = tables * (lenghtM + 2 * 0.30) * (widthM + 2 * 0.30);
  12.         double areaSquares = tables * (lenghtM / 2) * (lenghtM / 2);
  13.         double priceDollars = areaCovers * 7 + areaSquares * 9;
  14.         double priceBGN = priceDollars * 1.85;
  15.  
  16.         System.out.printf("%.2f USD %n", priceDollars);
  17.         System.out.printf("%.2f BGN", priceBGN);
  18.  
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement