galinyotsev123

ProgBasics02Simple-Operations-Y05DanceHall

Jan 12th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Y05DanceHall {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. double length = Double.parseDouble(scanner.nextLine());
  7. double width = Double.parseDouble(scanner.nextLine());
  8. double Garderob = Double.parseDouble(scanner.nextLine());
  9.  
  10. double lengthInCm = length * 100;
  11. double widthInCm = width * 100;
  12. double GarderobInCm = Garderob * 100;
  13. double SpacePerDancer = 40+7000;
  14.  
  15.  
  16. double DanceRoomSize = lengthInCm * widthInCm; //goleminata na zalata v m2
  17. double WardrobeSize = GarderobInCm * GarderobInCm; // goleminata na garderoba
  18. double BenchSize = DanceRoomSize / 10; //golemina na peikata
  19.  
  20. double Dancing = DanceRoomSize - WardrobeSize - BenchSize;
  21. double QuantityDancers = Math.floor (Dancing / SpacePerDancer);
  22. System.out.printf("%.0f", QuantityDancers);
  23.  
  24. }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment