Advertisement
Guest User

Untitled

a guest
Jan 15th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class DanceHall {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.         double lenght = Double.parseDouble(scan.nextLine());
  7.         double weight = Double.parseDouble(scan.nextLine());
  8.         double sideA = Double.parseDouble(scan.nextLine()); //wardrobe
  9.  
  10.         double areaHall = (lenght * 100) * (weight * 100); // m3 to sm3
  11.         double bench = areaHall / 10;
  12.         double areaA = (sideA * 100) * (sideA * 100); //wardrobe
  13.         double freeSpace = areaHall - bench - areaA;
  14.  
  15.         double dancers = freeSpace / (40 + 7000);
  16.         int result = (int)Math.round(dancers); //from double to int
  17.         System.out.println(result);
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement