Kancho

Untitled

Jan 19th, 2019
87
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 Exam3_3_10_2018_WeddingHall {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. double hallLengthCm = Double.parseDouble(scanner.nextLine());
  8. double hallWidthCm = Double.parseDouble(scanner.nextLine());
  9. double barSideCm = Double.parseDouble(scanner.nextLine());
  10.  
  11. int hallArea = (int) (hallLengthCm * hallWidthCm);
  12. int barSideArea = (int) (barSideCm * barSideCm);
  13. double danceFloorArea = hallArea * 0.19;
  14. double freeSpace = hallArea - danceFloorArea - barSideArea;
  15.  
  16. int numberGuests = (int) Math.ceil(freeSpace/ 3.2);
  17.  
  18. System.out.println(numberGuests);
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment