galinyotsev123

ProgBasics02Simple-Operations-Y04TailoringWorkshop

Jan 12th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Y04TailoringWorkshop{
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. double Tables = Integer.parseInt(scanner.nextLine());
  7. double lenght = Double.parseDouble(scanner.nextLine());
  8. double wide = Double.parseDouble(scanner.nextLine());
  9.  
  10. double areaPokrivka = Tables * (lenght+2*0.3)*(wide+2*0.3);
  11. double areaKareta = Tables * (lenght/2)*(lenght/2);
  12. double PriceUSD = (areaPokrivka*7)+(areaKareta*9);
  13. double PriceUSDtoBGN = PriceUSD*1.85;
  14. System.out.printf("%.2f USD", PriceUSD );
  15. System.out.println();
  16. System.out.printf("%.2f BGN", PriceUSDtoBGN);
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment